Eclipse 运行项目抛UnsupportedClassVersionError弹出yunCould not find the main class.program will exit
来源:互联网 发布:知乎百万英镑 编辑:程序博客网 时间:2024/06/05 03:58
出现Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 错误的原因,是因为我们使用高版本的JDK编译的Java class文件试图在较低版本的JVM上运行,所报的错误。
因为,高版本的JDK生成的class文件使用的格式,可能与低版本的JDK的.class文件格式不同。这样,低版本的JVM无法解释执行这个.class文件,会抛出Could not find the main class.program will exit,java.lang.UnsupportedClassVersionError不支持的Class版本错误。
eclipse下有几个需要使用jre的地方。第一个是编译器使用,第二个是开发使用,第三个是运行时使用。
遗憾的是这三个是需要分别配置的,你的问题就在于eclipse的这三个包之间有版本冲突!
Windows->Proferences->java-> Installs Jres重新设置JDK路径
Windows->Proferences->java->Compiler,将compiler compliance level设置为与上面相同的JDK
这样试了一下还是不行,发现对于项目来说,compiler compliance level也有不同,
Windows->Proferences->java->Compiler->config project specific settings
- Eclipse 运行项目抛UnsupportedClassVersionError弹出yunCould not find the main class.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.
- 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
- Could not find the main class.Program will exit.
- Could not find the main class. Program will exit.
- junit: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
- 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
- 运行tomcat7w.exe未安装指定的服务S
- Java系列教程目录表
- 结构型模式-装饰模式
- Qt5.0 编写DLL 并调用
- MPMoviePlayerController无法播放视频的原因
- Eclipse 运行项目抛UnsupportedClassVersionError弹出yunCould not find the main class.program will exit
- Yii框架zii.widgets.grid自定义按钮,ajax触发事件并提示
- 在Linux下安装和使用MySQL
- C语言预处理运算符
- 关于DIV布局中图片留白的个人见解
- 禁止屏幕随手机旋转变化
- 智能卡的使用
- 谷歌产品经理眼中的产品经理
- 用户流失原因调研四步经