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 org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.craftbukkit.v1_9_R1.CraftServer.loadPlugins(CraftServer.java:296) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.craftbukkit.v1_9_R1.CraftServer.reload(CraftServer.java:743) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.Bukkit.reload(Bukkit.java:539) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.craftbukkit.v1_9_R1.CraftServer.dispatchCommand(CraftServer.java:645) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PlayerConnection.handleCommand(PlayerConnection.java:1302) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:1137) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_80]
            at java.util.concurrent.FutureTask.run(Unknown 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(MinecraftServer.java:721) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at java.lang.Thread.run(Unknown 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 java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.7.0_80]
            at java.net.URLClassLoader.defineClass(Unknown Source) ~[?:1.7.0_80]
            at java.net.URLClassLoader.access$100(Unknown Source) ~[?:1.7.0_80]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_80]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_80]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_80]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_80]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[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 org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd]
            ... 21 more
     
    #1 Ilomiswir, Jun 23, 2016
    Last edited: Jun 23, 2016
  2. Choco

    Moderator

    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

    Moderator

    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

    Moderator

    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.