myeclipse启动tomcat 出现could not find the main class Program will exit
2012-01-18 10:16
399 查看
摘录自http://blog.163.com/zhihui20080313@126/blog/static/1012819832010102474828788/
tomcat启动时报错:
java.lang.UnsupportedClassVersionError:
Bad version number in .class file
原因:编译java时生成的class文件,在运行时用到的JRE和class文件版本不一致造成的。
1 如果是一般的java程序:
可以在MyEclipse中修改JRE的路径和版本。在Window->Preferences中,打开如下位置,就可修改JRE:
修改完之后,最好重新编译一下,选Project->Clean... 选项,然后选择是所有的项目都要重新编译,还是只重新编译指定的项目,然后就应该没问题了。
2 如果是Web 程序
就要修改Tomcat运行时的JDK环境了,如下图:
tomcat启动时报错:
java.lang.UnsupportedClassVersionError:
Bad version number in .class file
原因:编译java时生成的class文件,在运行时用到的JRE和class文件版本不一致造成的。
1 如果是一般的java程序:
可以在MyEclipse中修改JRE的路径和版本。在Window->Preferences中,打开如下位置,就可修改JRE:
修改完之后,最好重新编译一下,选Project->Clean... 选项,然后选择是所有的项目都要重新编译,还是只重新编译指定的项目,然后就应该没问题了。
2 如果是Web 程序
就要修改Tomcat运行时的JDK环境了,如下图:
相关文章推荐
- Myeclips运行的的时候出现Could not find the main class:Main. Program will exit.
- MyEclipse导入项目错误:Could not find the main class.Program will exit.
- 安装java的时候出现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: org.elasticsearch.bootstrap.Elasticsearch. Program will exit.
- java virtual machine launcher Could not find the main class. Program will exit
- could not find the main class, Program will exit(已解决)
- Java执行main方法,异常为: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 问题
- 【解决方法】Could not find the main class Program will exit
- 启动tomcat的时候报错信息如下:. Could not find the main class: org.apache.catalina.startup.Bootstrap. Program wi
- 转:could not find the main class, Program will exit (说明编译器compiler版本要不高于installed JREs,JVM版本)
- Could not find the main class. Program will exit
- Could not find the main class. Program will exit
- [Web开发笔记][3]MyEclipse 8.0启动Tomcat 7报错:Could not find the main class: org.apache.catalina.startup……
- java调用本地方法的时候报错 could not find the main class:xx.program will exit
- could not find the main class. Program will exit.
- Could not find the main class. Program will exit