java:Could not find the main class.Program will exit 原因分析-新解决办法
来源:互联网 发布:ann神经网络 python 编辑:程序博客网 时间:2024/05/01 17:10
出现Could not find the main class.program will exit 错误的原因,是因为我们使用高版本的JDK编译的Java class文件试图在较低版本的JVM上运行,所报的错误。
因为,高版本的JDK生成的class文件使用的格式,可能与低版本的JDK的.class文件格式不同。这样,低版本的JVM无法解释执行这个.class文件,会抛出Could not find the main class.program will exit不支持的Class版本错误。
这个错误尤其在JDK5与JDK5之前的版本上表现明显。因为,JDK5在Java语法上作了不少增强,引入了一些新的.class文件的元素,导致旧版本的JVM无法解释、执行.class文件。即使这个类并没有使用任何JDK5的新元素,但是JDK5生成的.class文件,JDK1.4及其以前的JVM都无法辨认!
解决方法:
1. 弄清楚该程序是在哪个JDK版本下开发的
2. 在myEclipse 菜单->Windows->Proferences->java-> Installs Jres重新设置JDK路径,改为开发程序时的JDK版本
3. Windows->Proferences->java->Compiler,将compiler compliance level设置为与上面相同的JDK
或者直接点可以看看Package Explorer下
后面的jdk是不是1.6,不一致就将解决方法3中的改了。。。。。
- java: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.
- junit: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
- 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
- 你必须知道的十大编程格言
- 成功十条
- (环境变量)http://www.51testing.com/?uid-227476-action-viewspace-itemid-99672
- 讲故事的能力:从功能到卖点
- hibernate配置jar
- java:Could not find the main class.Program will exit 原因分析-新解决办法
- 中国500强的CEO们对80.90后的忠告
- Spring 3.1 注释方式实现拦截器无效问题解决办法
- windows mobile 5.0 下创建Extension DLL
- 实现wince6 休眠 唤醒 流程和分析
- 2812从内部flash启动的过程
- 如何后台运行python cgi程序
- 创造力,源于对事物本质的深刻洞察
- c++构造函数