Not sure how to change compiler version

Discussion in 'Bukkit Help' started by GenerallyBlinky, Mar 1, 2021.

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

    GenerallyBlinky

    So I made a plugin (Not finished) and wanted to test it out. After exporting it and putting it in the plugins folder, I found that when the server was up and running, it didn't include the command I had made. So I did what anybody else would do and did /plugin. Apparently there was no plugins installed. After searching through forum posts, someone had been told to look in latest.log. So I did the same, and found this:
    Code:
    [09:42:58] [Server thread/ERROR]: Could not load 'plugins\bettercrafttest.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/generallyblinky/bettercraft/Main has been compiled by a more recent version of the Java Runtime (class file version 59.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.jar:3016-Spigot-73fb609-ea050e6]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:382) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:185) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
    Caused by: java.lang.UnsupportedClassVersionError: me/generallyblinky/bettercraft/Main has been compiled by a more recent version of the Java Runtime (class file version 59.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_271]
        at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_271]
        at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_271]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:163) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:96) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_271]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_271]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_271]
        at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_271]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
        ... 7 more
    After this, I decided to Google for how to change the compiler version. I found how, but the compilance only went up to 15, as shown in the image. So I came here for help, and I hope someone can help.
     
    Last edited by a moderator: Mar 1, 2021
  2. Online

    KarimAKL

    @GenerallyBlinky The server is running Java 8 while you compiled your plugin for Java 15.

    You can either change the version in the IDE to match the server, or you can change the server version to match the plugin.
     
    Last edited: Mar 1, 2021
Thread Status:
Not open for further replies.

Share This Page