课程不支持主要或次要版本号 [英] Class has unsupported major or minor version numbers
问题描述
在Eclipse中,我创建了一个链接到ejb和模型的EAR项目。我跑了EAR,我收到以下错误:
In Eclipse I created an EAR project linked to an ejb and a model. I ran the EAR and I got the following error:
无法部署earkmz
cannot Deploy earkmz
deploy is failing =部署时发生错误:部署应用程序时出现异常[earkmz]:UnsupportedClassVersionError:class it.j2ee.kmZ.business.impl.JPACartService具有不受支持的主版本号或次要版本号,大于Java中发现的版本号运行环境版本1.6.0_43。请参阅server.log了解更多详细信息。
deploy is failing=Error occurred during deployment: Exception while deploying the app [earkmz] : UnsupportedClassVersionError: Class it.j2ee.kmZ.business.impl.JPACartService has unsupported major or minor version numbers, which are greater than those found in the Java Runtime Environment version 1.6.0_43. Please see server.log for more details.
我的系统上只有一个JRE(1.6.0_43),所以它是我不太可能用另一个JDK版本错误地编译了我的课程。
I've got only one JRE on my system (1.6.0_43), so it's not possible that I wrongly compiled my classes with another JDK version.
我检查过我的设置是否正确的位于窗口>首选项> Java>编译器>编译器合规级别> 1.6
。
I checked that my settings were right under Window > Preferences > Java > Compiler > Compiler compliance level > 1.6
.
我的项目类是从另一个项目复制粘贴的,但是我尝试从头写入,结果是一样的。我在这里缺少什么?
My project classes are copy-pasted from another project, but I tried to write them from scratch and the result is the same. What am I missing here?
推荐答案
请确认
>属性 - > Java编译器
Project -> Properties -> Java Compiler
,并将合规级别设置为1.6。
and set the compliance level over there as 1.6.
这篇关于课程不支持主要或次要版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!