Solved Java version error

Discussion in 'Plugin Development' started by AntonioC94, Nov 23, 2019.

  1. Offline

    AntonioC94

    Hi guys!

    So this is my problem. Days ago i formatted my computer, so now im seting up my workspace and when i want to try if all is doing well, i have this error when a test plugin is loading. Im not really sure about how to solve this.

    Code:
    [11:01:10] [Server thread/ERROR]: Could not load 'plugins\test.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: io/github/shilodabing/test/test has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:334) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:253) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:194) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:776) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
    Caused by: java.lang.UnsupportedClassVersionError: io/github/shilodabing/test/test has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_221]
            at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_221]
            at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_221]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:131) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
            at java.lang.Class.forName0(Native Method) ~[?:1.8.0_221]
            at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_221]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:59) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
            ... 6 more
    
     
  2. Offline

    yPedx

    Code:
    io/github/shilodabing/test/test has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    You must set the compilation version for Java to Java 8. This error means that your server is not running the same Java version as your plugin was compiled with (created with).
     
  3. Offline

    AntonioC94

    Hi!, so.. i changed the version to 1.8 and still getting the error D:
     
  4. Offline

    bwfcwalshy Retired Staff

    You're compiling with Java 12 and running the server with Java 8
     

Share This Page