java.lang.ClassLoader.defineClass1(Native Method) 不支持major.minor 版本52.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26576883/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 10:11:13  来源:igfitidea点击:

Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method)

java

提问by CHowdappaM

running fedora 20 and using gedit as my editor. when i compile my program and then try to run it using terminal, this happens:

运行 fedora 20 并使用 gedit 作为我的编辑器。当我编译我的程序然后尝试使用终端运行它时,会发生这种情况:

Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) ABRT problem creation: 'success' i have tried the simple google search but all i can find out is that the program is being compiled using a later version of java and being run with another. however, all the solutions i came across are based on eclipse and i am not using this.

Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) ABRT problem creation: 'success' 我已经尝试了简单的谷歌搜索,但我只能发现该程序正在使用更高版本的 java 进行编译并与另一个版本一起运行。但是,我遇到的所有解决方案都基于 Eclipse,我没有使用它。

please help!

请帮忙!

回答by Harish Ramkumar

The error that you are getting because you are using different version of Java. Try down grading to Java 1.7 or Java 1.6 if you are using Java 1.8.

由于您使用不同版本的 Java 而导致的错误。如果您使用的是 Java 1.8,请尝试降级到 Java 1.7 或 Java 1.6。

Hope this helps.

希望这可以帮助。

回答by CHowdappaM

It will help you. Its because, your compiler and JVM versions mismatch. Your IDE tools might have options to change Compiler version.

它会帮助你。这是因为,您的编译器和 JVM 版本不匹配。您的 IDE 工具可能具有更改编译器版本的选项。

Unsupported major.minor version 52.0

不支持的 Major.minor 版本 52.0

How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

如何修复 java.lang.UnsupportedClassVersionError: Unsupported major.minor version