Solved UnsupportedClassVersionError

Discussion in 'Plugin Development' started by NonameSL, Apr 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    NonameSL

    Code:
    Could not load 'plugins\SLCraft.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/NonameSL/SLCraft/Main : Unsupported major.minor version 51.0
    
    I am getting this error in both of my plugins, and that is very odd because it is the exact same error. Both the server and my plugins are for minecraft 1.7.2, and the odd thing is that every other plugin works but mine. Why?
     
  2. Try to use
    Code:java
    1. version: 1.0
    in plugin.yml
     
  3. Offline

    hatstand

    What. I don't even.

    That error is because you compiled your plugin using/against Java 7, and are running it on Java 6.
     
  4. Offline

    NonameSL

    Okay. Why am I suddenly compiling my plugin aginst Java 7? This just happened one day when I compiled my plugins, but before that everything was fine. How do I compile them aginst Java6 then?
     
  5. Offline

    xize

    NonameSL

    what IDE are you using eclipse?

    if it is you could configurate your JRE/JDK in your project or maybe even in eclipse configuration it self.

    you probably have more jre or jdk's installed on the machine which result in these kind of problems as default the IDE chooses the highest JDK/JRE installed on the machine, and probably minecraft and the server still uses the java 6 jdk/jre.

    note for java 6 you may need to signup on oracle, http://www.oracle.com/technetwork/java/javase/archive-139210.html
     
  6. Offline

    NonameSL

    xize
    Thanks! I got it working. I entered Computer>Properties>Advanced System Settings>Enviornment Variables and changed PATH to C:/Program Files(86x)/java/jre7/bin instead of jre6 ( I probably changed it somewhen and didn't remember) and now it works.
     
Thread Status:
Not open for further replies.

Share This Page