Runnable JAR file error: Unsupported major.minor version 51.0

大憨熊 提交于 2019-12-08 06:52:59

问题


I made an application in Java (version 7) with Eclipse (Indigo) when I exported my application interface on a Runnable JAR file on my computer and tried it worked fine, then I tried on another computer and I get this problem

Exception in thread "main" java.lang.UnsupportedClassVersionError: cliente/Princ
ipal : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)

I saw other post that this can be because the other computer have an older version of Java than mine, can somebody confirm this please?.


回答1:


Yes, that is the error when you try to run Java bytecode with an older version that the version you build it with.

You will find more information in this question.



来源:https://stackoverflow.com/questions/17081735/runnable-jar-file-error-unsupported-major-minor-version-51-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!