Solved Error on console.

Discussion in 'Plugin Development' started by MrKoLoTeR, Jan 5, 2021.

  1. Offline

    MrKoLoTeR

    A few days ago there was a problem after which, all the new plugins that I want to write do not work.
    The console shows an error:

    [01:17:54 ERROR]: Could not load 'plugins\GrandProtect.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError
    : ru/GrandProtect/Main has been compiled by a more recent version of the Java Ru
    ntime (class file version 54.0), this version of the Java Runtime only recognize
    s class file versions up to 52.0
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:131) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:329) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.j
    ava:318) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.ja
    va:222) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.jav
    a:616) ~[patched_1.12.2.jar:git-Paper-1618]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
    Caused by: java.lang.UnsupportedClassVersionError: ru/GrandProtect/Main has been
    compiled by a more recent version of the Java Runtime (class file version 54.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:152) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:104) ~[patched_1.12.2.jar:git-Paper-1618]
    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.jav
    a:82) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:127) ~[patched_1.12.2.jar:git-Paper-1618]
    ... 6 more
     
  2. Offline

    Ago19

    Did you change the version the server was running on?
    Did you write something else to GrandProject.jar?
    Maybe the plugin is too big and you need to update your and the server Java version to allow the bigger files to be compiled.


    These are some parts that I found interesting in the log message:


    PS: I'm not a professional java user, this are just my assumptions about the problem
     
    MrKoLoTeR likes this.
  3. Online

    CraftCreeper6

    @MrKoLoTeR
    You are compiling with a different version of Java than the server.
     
  4. Offline

    MrKoLoTeR

    How can I solve this problem in more detail?

    Thanks, but no, I have not changed the version on which the server was running and the plugin is not large
    Thanks, but no, I have not changed the version on which the server was running and the plugin is not large.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 6, 2021
  5. Online

    CraftCreeper6

    @MrKoLoTeR
    Change the version of Java you are compiling with to be the same version that the server is running.
     
  6. Offline

    Ago19

    For version until 1.16 you need to compile in Java 1.8 , for 1.17 and beyond you need at least Java 1.11, or something like that
     
  7. Offline

    MrKoLoTeR

    Thank you!
     

Share This Page