7

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.

Madster
  • 83
  • 1
  • 1
  • 8

3 Answers3

16

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:
Community
  • 1
  • 1
user253751
  • 57,427
  • 7
  • 48
  • 90
  • This did not work for me. I also tried downloading JDK 7, but that did not work either. – CoderGuy123 May 31 '15 at 07:26
  • @Deleet What didn't work? – user253751 May 31 '15 at 07:54
  • I have the same error after setting all settings to JDK 1.7. – CoderGuy123 May 31 '15 at 07:55
  • @Deleet Check in the project's properties as well. Individual projects can override the global settings. – user253751 May 31 '15 at 08:05
  • I have disabled the individual project settings to avoid that (always use default which is JDK 7). Bizarrely, I have 4 jsp pages and 3 of them works, but 1 does not. They have identical import settings (I am certain because they import using the same include call). – CoderGuy123 May 31 '15 at 08:08
  • 1
    Actually, these pages do not work completely, but they don't break before the function gets called. I.e. there is no error before the functions are called, importing them is fine. – CoderGuy123 May 31 '15 at 08:21
1

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

Jens
  • 67,715
  • 15
  • 98
  • 113
1

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.

Svetlin Zarev
  • 14,713
  • 4
  • 53
  • 82