UnsupportedClassVersionError的原因是什么? [英] What is the reason for UnsupportedClassVersionError?

查看:906
本文介绍了UnsupportedClassVersionError的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.MacLauncher.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:115)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)

我根本不明白这一点;谁能解释一下呢?谢谢

I don't understand this at all; can anyone explain it simply? Thanks

推荐答案

当您使用较新版本的JDK编译代码并尝试在较旧版本上运行时,可能会发生此错误版本的 JVM 。这是您自己编译的代码吗?您使用的是IDE(如Eclipse)吗?尝试更新您的 JRE

This error can occur when you compile the code with a newer version of the JDK and try to run it on an older version of the JVM. Is this your own code you're compiling and are you using an IDE (like Eclipse)? Try updating your JRE.

这篇关于UnsupportedClassVersionError的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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