解决 class file has wrong version 49.0, should be 48.0 的方法

来源:互联网 发布:什么软件玩页游 编辑:程序博客网 时间:2024/05/19 18:12
 
有些时间,我们会遇到版本不匹配的问题。如:
bad class file: /usr/java/jdk1.5.0_06/jre/lib/rt.jar(java/lang/Object.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.

这是因为编译环境和运行环境的不一致造成的,比如tomcat5.5和jdk1.5配合的时候,可能就会出现。解决这个问题的方法:copy jdk1.5的lib/tools.jar到tomcat5.5的common/lib/tools.jar,覆盖掉原有文件就可以了。
原创粉丝点击