myeclipse出现Could not find the main class原因分析
2014-11-12 11:27
417 查看
博客分类:
工具使用
MyeclipseJavaEclipseBlog 昨天晚上像往常一样打开myeclipse,随便运行一个类(run as java application),居然弹出Could not find the main class.Program will exit.
按照以往的经验,做如下检查:
编译环境检查 window->preferences->installed JREs
编译级别检查 右击工程名->properties->java compiler
编译路径检查 右击工程名->build path->coufiguration build path
执行clean project->clean
按照上面的检查后发现,没有任何问题,并且在同一个workspace中的工程里的class都能正常运行。
看来跟该工程的相关设置文件有关了(例如.classpath,.mymetadata,.mymetadata),于是乎
将工程拷贝一份重新建立了一个新工程,并进行了比对,果然发现了问题:
.classpath文件跟新建的工程中的不同(可参考http://leagion.iteye.com/blog/477849),但
杯具的是,我将新建的工程中的.classpath覆盖原工程中的.classpath后,问题依旧,真是无奈,最后
查看了run configurations的java application中发现有很多原来运行的类,全部删除,重新运行居然
好了,神马就是浮云啊!
总结:遇到此类问题,请首先查看运行环境的配置(如jre,classpath,complie level等),执行clean操作,
删除之前的run configurations中的java application中的记录,实在不行就只好重新建立工程了。毕竟像
myeclipse(eclipse)这种工具总会出现这样那样的问题,有些确实很难找到根源,只能绕道解决了。
相关文章推荐
- myeclipse启动tomcat 出现could not find the main class Program will exit
- 【解决】Maven myeclipse出现Could not find the main class
- 安装java的时候出现Could not find the main class.program will exit
- could not find the main class win7/xp 双击执行jar包出现:could not find the main class
- could not find the main class win7/xp 双击执行jar包出现:could not find the main class
- 安装MyEclipse时,双击安装包后出现“could not find main class”的错误提示的解决方法
- [Web开发笔记][3]MyEclipse 8.0启动Tomcat 7报错:Could not find the main class: org.apache.catalina.startup.Boostrap.
- 用MyEclipse启动tomcat 报错Could not find the main class
- Eclipse中执行Ant出现Could not find the main class的问题及解
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- Eclipse中执行Ant脚本出现Could not find the main class的问题及解
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- windows 双击执行jar包出现:could not find the main class
- could not find the main class win7/xp 双击执行jar包出现:could not find the main class
- [Web开发笔记][3]MyEclipse 8.0启动Tomcat 7报错:Could not find the main class: org.apache.catalina.startup……
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- 可执行jar包的处理,以及could not find the main class win7/xp 双击执行jar包出现:could not find the main class的问题处理
- 运行jar文件时,出现“could not find the main class”的解决方法
- java程序运行时出现问题:Could not find the main class: test_jena. Program will exit.
- [Web开发笔记][3]MyEclipse 8.0启动Tomcat 7报错:Could not find the main class: org.apache.catalina.startup.Boostrap.