Eclipse运行异常:Could not find the main class. Program will exit.
2013-04-02 10:11
411 查看
原因:本机上存在多个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即可)。
相关文章推荐
- Java执行main方法,异常为:could not find the main class.program will exit
- Java执行main方法,异常为:could not find the main class.program will exit
- Eclipse运行异常:Could not find the main class. Program will exit.
- Debian配置JAVA环境报错之Could not find the main class: HelloWorld. Program will exit.
- java virtual machine launcher Could not find the main class. Program will exit
- Eclipse 出错: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 解决方案解决办法
- 解决java virtual machine launcher could not find the main class. program will exit
- myeclipse启动tomcat 出现could not find the main class Program will exit
- could not find the main class. Program will exit.
- Could not find the main class: org.apache.catalina.startup.Boostrap. Program will exit
- 【解决方法】Could not find the main class Program will exit
- 问题解决了,可是为什么呢?could not find the main class.program will exitmain
- Could not find the main class. Program will exit.
- java程序运行时出现问题:Could not find the main class: test_jena. Program will exit.
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- Could not find the main class. Program will exit
- 解决运行java application时提示Could not find the main class.Program will exit.问题