java JVMCFRE003 错误的主要版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35777082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JVMCFRE003 bad major version
提问by Ekta
I have build a jar file using Ant on my Windows OS using Oracle Java 1.7. When I deploy the jar on my CentOS machine (which has WAS 8.5.5) running on open JDK 1.8, get the following error:
我使用 Oracle Java 1.7 在我的 Windows 操作系统上使用 Ant 构建了一个 jar 文件。当我在运行开放 JDK 1.8 的 CentOS 机器(具有 WAS 8.5.5)上部署 jar 时,出现以下错误:
java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=com/ac/ps/ft/home/ad/cr/testclass, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:295)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:853)
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:763)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:586)
at java.lang.ClassLoader.loadClass(ClassLoader.java:690)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:182)
I'm not sure what exactly is the problem. I have tried compiling with Java 1.8 but it still gives the same error. Please help.
我不确定到底是什么问题。我试过用 Java 1.8 编译,但它仍然给出同样的错误。请帮忙。
回答by Azquelt
JVMCFRE003 looks like an IBM Java error code, so I don't think your application server is running with Open JDK. You could confirm the java version used by looking at the top of your SystemOut log.
JVMCFRE003 看起来像一个 IBM Java 错误代码,所以我认为您的应用程序服务器没有运行 Open JDK。您可以通过查看 SystemOut 日志的顶部来确认使用的 Java 版本。
If you're using traditional Websphere Application Server (rather than liberty) then it will always use the JRE that was installed with the app server.
如果您使用的是传统的 Websphere Application Server(而不是自由),那么它将始终使用与应用程序服务器一起安装的 JRE。
In this case, use installation manager to make sure you have an appropriate Java level installed, then use the managesdk commandto enable it.
在这种情况下,请使用安装管理器确保您安装了适当的 Java 级别,然后使用managesdk 命令启用它。