“selection does not contain a main type”解决方法

        在运行java程序时,出现了错误“selection does not contain a main type”。

       是因为.java文件不在项目的src路径内,也就是说源代码未被eclipse编译,字节码不存在无法运行了。我在新建java project时勾选了Create separate folders for sources and class files。事实上,不应使用默认 项,应勾选Use project folder for sources and class files。

posted @ 2016-04-15 10:48  翎飞蝶舞  阅读(7615)  评论(0编辑  收藏  举报