Eclipse运行异常:Could not find the main class. Program will exit.
2013-07-17 09:44
501 查看
原因:本机上存在多个JDK版本(即:1.4和1.5两个版本),由于的默认JDK版本与Eclipse工具使用的JDK版本不一致,所以产生如上异常。
解决办法:使默认的JDK版本与Eclipse工具使用的JDK版本保持一致即可。具体处理方式如下。
1、首先核查Eclipse使用的JDK版本。Window --> Preferences --> Java --> Installed JREs。在右侧的Installed JREs窗口中查看当前使用的JDK版本(本机设置的是JDK1.4)。
2、鼠标点击工程,使鼠标聚焦在该工程上,然后点击菜单栏Project --> Properties --> Java Compiler。在其右侧的JDK Compliance中,查看Compiler compliance level中的JDK版本是否与上面查看的JDK版本一致,若不一致,使其保持一致即可(本机中该工程默认的版本为5.0,将其版本号修改为1.4即可)。
解决办法:使默认的JDK版本与Eclipse工具使用的JDK版本保持一致即可。具体处理方式如下。
1、首先核查Eclipse使用的JDK版本。Window --> Preferences --> Java --> Installed JREs。在右侧的Installed JREs窗口中查看当前使用的JDK版本(本机设置的是JDK1.4)。
2、鼠标点击工程,使鼠标聚焦在该工程上,然后点击菜单栏Project --> Properties --> Java Compiler。在其右侧的JDK Compliance中,查看Compiler compliance level中的JDK版本是否与上面查看的JDK版本一致,若不一致,使其保持一致即可(本机中该工程默认的版本为5.0,将其版本号修改为1.4即可)。
相关文章推荐
- Eclipse 运行项目抛UnsupportedClassVersionError弹出yunCould not find the main class.program will exit
- JAVAEclipse:could not find the main class,program will exit!
- [Eclipse] Could not find the main class. Program will exit
- Java执行main方法,异常为:could not find the main class.program will exit
- Java执行main方法,异常为:could not find the main class.program will exit
- 解决运行java application时提示Could not find the main class.Program will exit.问题
- java程序运行时出现问题:Could not find the main class: test_jena. Program will exit.
- Eclipse 出错:Could not find the main class. Program will exit
- Eclipse运行异常:Could not find the main class. Program will exit.
- Myeclips运行的的时候出现Could not find the main class:Main. Program will exit.
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- Could not find the main class. Program will exit
- could not find the main class,program will exit
- could not find the main class .program will exit的解决方案
- Could not find the main class. Program will exit.
- MyEclipse导入项目错误:Could not find the main class.Program will exit.
- Could not find the main class: org.apache.catalina.startup.Boostrap. Program will exit
- javaw和* Could not find the main class. Program will exit!
- could not find the main class. Program will exit.