Java Unsupported major.minor version 52.0 error Minecraft [duplicate]

点点圈 提交于 2019-12-03 13:05:49

问题


I am currently trying to run a plugin im working on onto a test server. The Minecraft server is running spigot 1.7.10, here is the servers java version:

java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

here is my java version

java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

So it makes no sense why I should be getting this error on my plugin when loading it.

26.11 02:19:38 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: mad/madster/msm/Main : Unsupported major.minor version 52.0

I am using eclipse luna on windows 8.


回答1:


You are compiling your plugin with the Java 8 compiler. You are running your server with Java 7, which is not capable of reading the Java 8-format class files in your plugin.

You can either:

  • Update the server to Java 8.
  • Make Eclipse use the Java 7 compiler (if it's installed on your development machine) by selecting a Java 7 JDK version, in Preferences > Java > Installed JREs:

  • Make Eclipse tell the Java 8 compiler to pretend to be the Java 7 compiler, by setting your "compiler compliance level" to 1.7, in Preferences > Java > Compiler:




回答2:


You have to download java8 and run it with this jre.




回答3:


Your code has been compiled with Java 8, while you are trying to run it with Java 7. Note that Eclipse has it's own compiler and does not use the one from the JDK and most probably it is configured to use Java 8. Check you eclipse compiler preferences.



来源:https://stackoverflow.com/questions/27143461/java-unsupported-major-minor-version-52-0-error-minecraft

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