Solved Error plugin loading

Discussion in 'Spigot Plugin Development' started by Ilomiswir, Jun 23, 2016.

  1. i have a plugin that is working in the server on my own pc but not working on any other server
    this is the error

    can you help me or tell what this error means

    Code (Text):
    [20:04:22 ERROR]: Could not load 'plugins/KitPVP.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: nl/IloDevelopers/IKitPVP/Main : Unsupported major.minor version 52.0
            at ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin( ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.craftbukkit.v1_9_R1.CraftServer.loadPlugins( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.craftbukkit.v1_9_R1.CraftServer.reload( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.Bukkit.reload( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.command.defaults.ReloadCommand.execute( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.command.SimpleCommandMap.dispatch( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.craftbukkit.v1_9_R1.CraftServer.dispatchCommand( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PlayerConnection.handleCommand( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PlayerConnection.a( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PacketPlayInChat.a( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PacketPlayInChat.a( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$ [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at java.util.concurrent.Executors$ Source) [?:1.7.0_80]
            at Source) [?:1.7.0_80]
            at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.MinecraftServer.D( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.DedicatedServer.D( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.MinecraftServer.C( [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at Source) [?:1.7.0_80]
    Caused by: java.lang.UnsupportedClassVersionError: nl/IloDevelopers/IKitPVP/Main : Unsupported major.minor version 52.0
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.7.0_80]
            at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.7.0_80]
            at Source) ~[?:1.7.0_80]
            at Source) ~[?:1.7.0_80]
            at$100(Unknown Source) ~[?:1.7.0_80]
            at$ Source) ~[?:1.7.0_80]
            at$ Source) ~[?:1.7.0_80]
            at Method) ~[?:1.7.0_80]
            at Source) ~[?:1.7.0_80]
            at ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_80]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_80]
            at java.lang.Class.forName0(Native Method) ~[?:1.7.0_80]
            at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_80]
            at<init>( ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            ... 21 more
    #1 Ilomiswir, Jun 23, 2016
    Last edited: Jun 23, 2016
  2. Choco


    Your plugin is compiled with Java 8, but the server you're running it on is running Java 7. The reason it works on your localhost server is because you are likely running it with JRE 8. Either compile your plugin with Java 7, or drop support for Java 7. If it's a free plugin, I suggest just dropping support for it; but that's just my opinion
  3. thx can i change it now from 8 to 7 without fully recoding the plugin?
  4. Choco


    Yes, just change your build path to use JDK 8 rather than JDK 7
  5. @2008Choco how would I make support for both java 8 & 7?
  6. thx it is working now
  7. Choco


    Java 8 is backwards compatible. If you compile for Java 7, servers running Java 8 will be able to run your plugin. The only downside is you'll be unable to use Java 8 features such as Streams, Lambdas, default interface methods, etc
  8. @2008Choco thanks a lot! Really helped me out because I had people messaging me about it :)
    • Like Like x 1
  9. Make your plugin in JDK 7 and then remake it in JDK 8. That will ensure total compatibility. You can obviously just copy/paste most code as Java 7 and Java 8 are very similar. You only need to worry about this if you use Java 8 features and try to run it in Java 7.