编译时异常:错误版本50.0,应为49.0 [英] Exception while compiling: wrong version 50.0, should be 49.0

查看:261
本文介绍了编译时异常:错误版本50.0,应为49.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JXL API处理一个应用程序,当我尝试使用eclipse IDE进行编译时,它正常工作,当我尝试在命令提示符下编译并显示以下异常时,它的编译也是一样的。

  Extract.java:6:无法访问jxl.read.biff.BiffException不良类文件:C:\Program Files\Java\jdk1 .5.0_01\jre\lib\ext\jxl.jar(jxl / read / biff / BiffException.class)
类文件错误版本50.0,应为49.0
请删除或制作确定它出现在classpa
th的正确子目录中。
import jxl.read.biff.BiffException;
^
1错误

编辑:



我可以使用JDK 1.6执行。由于JDK 1.6还必须与较低版本兼容,为什么不支持在JDK 1.5中编译的类文件。

解决方案

p>您使用的库是使用Java 6编译的。



您的编译器是Java 5,这就是为什么它不了解这种格式。



要修复它,您必须获取1.5版本的库或将编译器升级到1.6,我建议稍后。


I am working an application with JXL API and when i tried compiling using eclipse IDE, it's working fine and the same is not compiling when i am trying to compile in Command prompt and showing the below exception..

Extract.java:6: cannot access jxl.read.biff.BiffException bad class file: C:\Program Files\Java\jdk1.5.0_01\jre\lib\ext\jxl.jar(jxl/read/biff/BiffException.class)
class file has wrong version 50.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
import jxl.read.biff.BiffException;
                     ^
1 error

EDIT:

I am able to executing using JDK 1.6. Since JDK 1.6 must also be compatible with lower versions, why doesn't it support the class files which were compiled in JDK 1.5.

解决方案

The library you're using was compiled with Java 6

Your compiler is Java 5 that's why it doesn't understand that format.

To fix it you have to get a 1.5 version of the library or upgrade your compiler to 1.6 I suggest the later.

这篇关于编译时异常:错误版本50.0,应为49.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆