JBOSS 点滴

丰丰的博客

MYeclipse问题集: class file has wrong version 49.0, should be 48.0

有些时候,我们会遇到版本不匹配的问题。如: 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.0Please 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,覆盖掉原有文件就可以了。


Unsupported major.minor version 49.0
 

电脑中装了很多JDK的版本,Eclipse中也分别有JDK1.4,JRE1.5,JRE1.6的Project,不同的项目需要经常切换JDK版本,执行某工程的时候突然出现“Unsupported major.minor version 49.0”的错误。

出现这样错误的原因是JDK1.5下编译的东西被放到了JDK1.4下执行。

Eclipse中修改方法:

「Window」->「Preferences」->「Java」->「Compiler」->「JDK Compliance level」->「1.4」改成1.4就OK了。
错误:class file has wrong version 49.0, should be 48.0也有可能是这个原因,我就活活被整了三天!

错误提示:The type ThreadLocal is not generic; it cannot be parameterized with arguments  <Session>
另外每个项目下的“JRE System Library[jdk1.4.2]"如果你看到这个JDK版本跟你不配,那么你就需要在类库右击:configure->edit library更改你的JRE了,因为JDK1。5以上有的新东东,1.4.5没有,所以就报这个错啦。

posted on 2009-05-27 22:53 半导体 阅读(1235) 评论(0)  编辑  收藏 所属分类: Eclipse


只有注册用户登录后才能发表评论。


网站导航: