错误: java.lang.UnsupportedClassVersionError: Bad version number in .class file

运行一个application程序时出错:

 java.lang.UnsupportedClassVersionError: Bad version number in .class file

出现这种错误的原因是:支撑web项目运行的服务器(tomcat/jboss/weblogic/...)使用的JDK版本与支撑application运行的JDK版本不一致.

 
改正方法: 

1.Window --> Preferences -->Java --> compiler中的compiler compliance level对应的下拉菜单中选择JDK版本
2.Window --> Preferences -->MyEclipse --> Servers -->tomcat/jboss/weblogic/...--> tomcat n.x /jboss n.x /weblogic n.x/...  -->JDK中的
Tomcat/Jboss/Weblogic/... JDK name下的下拉菜单中选择自身电脑上安装的JDK版本
两个jdk版本一致就好了!!!!

更多详细信息请查看 java教程网 http://www.itchm.com/forum-59-1.html

猜你喜欢

转载自yiheng.iteye.com/blog/1634881