Solved Plugin works on Windows but not Linux

Discussion in 'Spigot Plugin Development' started by origin658, Jun 16, 2016.

  1. I created a plugin and it works fine on a windows sever, but when its on a Linux server it gives an error.

    Both servers are identical apart from the operating system.

    Code (Text):
    [12:01:14] [Server thread/ERROR]: Could not load 'plugins/FirstPlugin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: England/Origin/FirstPlugin/Main : Unsupported major.minor version 52.0
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.loadPlugins(CraftServer.java:297) [spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at net.minecraft.server.v1_10_R1.DedicatedServer.init(DedicatedServer.java:202) [spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:539) [spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at java.lang.Thread.run(Thread.java:745) [?:1.7.0_95]
    Caused by: java.lang.UnsupportedClassVersionError: England/Origin/FirstPlugin/Main : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.7.0_95]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[?:1.7.0_95]
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.7.0_95]
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[?:1.7.0_95]
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[?:1.7.0_95]
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[?:1.7.0_95]
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[?:1.7.0_95]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_95]
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[?:1.7.0_95]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_95]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_95]
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_95]
        at java.lang.Class.forName(Class.java:278) ~[?:1.7.0_95]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.10.jar:git-Spigot-6016ac7-10c10b3]
        ... 6 more
     
  2. Unsupported major.minor version 52.0

    Google it, this has been asked tons of times.
     
  3. Choco

    Moderator

    You compiled your plugin in Java 8. Some servers don't support it
    EDIT: Sniped by @megamichiel
     
  4. Okay thanks. So if i compile the plugin on java version that the sever is running it should be ok?
     
    • Like Like x 1
  5. It is advised to simply update the server to Java 8. Java 7 has been EOL for over a year now and is no longer receiving security updates. Don't downgrade your plugin to Java 7...
     
    • Like Like x 1
    • Winner Winner x 1
    • Informative Informative x 1
  6. Okay, ill upgrade the server to java 8. Thanks.