Java不支持的major.minor版本52.0错误Minecraft [英] Java Unsupported major.minor version 52.0 error Minecraft

查看:96
本文介绍了Java不支持的major.minor版本52.0错误Minecraft的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在测试服务器上运行即时消息插件. Minecraft服务器正在运行spigot 1.7.10,以下是服务器的Java版本:

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)

这是我的Java版本

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

我正在Windows 8上使用Eclipse Luna.

I am using eclipse luna on windows 8.

推荐答案

您正在使用Java 8编译器来编译插件.您正在使用Java 7运行服务器,该Java无法读取插件中的Java 8格式的类文件.

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.

您可以:

  • 将服务器更新为Java 8.
  • 在首选项">"Java">已安装的JRE"中选择Java 7 JDK版本,以使Eclipse使用Java 7编译器(如果已将其安装在开发计算机上):
  • 通过在首选项">"Java">编译器"中将编译器遵从性级别"设置为1.7,使Eclipse告诉Java 8编译器假装为Java 7编译器:
  • 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:

这篇关于Java不支持的major.minor版本52.0错误Minecraft的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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