Bad version number in .class file 异常

来源:互联网 发布:bec背单词软件 编辑:程序博客网 时间:2024/05/17 13:41

      刚进公司,公司有个项目需要维护,导入项目,发现项目老是报错,查找了些相关资料,是因为我修改了 jdk 版本,@override 在 jdk 1.5 环境下报错,于是修改 jdk 版本为 jdk 1.6 ,就报 Bad version number in .class file 异常。

    【解决方案】

        一、选择当前工程,进入项目属性后,选择Java Compiler ==> 将Compiler Compliance level 改成当前jdk的版本;

     二、windows ==> preferences ==> MyEclipse Enterprise Workbench ==> Servers ==> Tomcat ==> 选择使用中的tomcat ==> JDK ==> 修改为当前使用的JDK版本即可。

     三、window ==> show view ==> 打开servers ==> configure ==> MyEclipse Enterprise Workbench ==> Servers ==> Integrated Sandbox ==> MyEclipse Tomcat 6 ==> JDK ==> Tomcat JDK name 选择你修改的版本即可。

         接下的操作如下图: