1.16.5 help

Discussion in 'Spigot Plugin Development' started by Mattia927292, Jul 26, 2021.

  1. java.lang.UnsupportedClassVersionError: me/mattio12123/CustomHelp/CustomHelp has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0



    what is this error?
    i need java 8 but i don't know how to install it
     
  2. Strahan

    Benefactor

    It means you are trying to use something compiled under Java 16 with Java 8. Upgrade your Java to 16. You're backwards; you don't need 8, you need 16.
     
  3. i solved, but i see this


    [20:47:59 ERROR]: Could not load 'plugins\customhelp1.0.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: main class `me.mattio12123.CustomHelp.CustomHelp' does not extend JavaPlugin
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:91) ~[patched_1.16.5.jar:git-Paper-732]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.16.5.jar:git-Paper-732]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.16.5.jar:git-Paper-732]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.16.5.jar:git-Paper-732]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-732]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-732]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1068) ~[patched_1.16.5.jar:git-Paper-732]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:290) ~[patched_1.16.5.jar:git-Paper-732]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_301]
    Caused by: java.lang.ClassCastException: class me.mattio12123.CustomHelp.CustomHelp
    at java.lang.Class.asSubclass(Unknown Source) ~[?:1.8.0_301]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:89) ~[patched_1.16.5.jar:git-Paper-732]
    ... 8 more




    sry is my first time doing this
     
  4. Make sure the CustomHelp class extends JavaPlugin if you have any problems please share your code and we will help you.
     
  5. Your main class must extend JavaPlugin
    La tua classe principale deve estendere JavaPlugin
     
  6. Strahan

    Benefactor

    Also in the future if you have code problems, it helps to show us the code. Use [CODE] brackets around the code to preserve formatting.
     
    • Like Like x 1
  7. i use clipseIDE.

    i used this tutorial:

    this is the CustomHelp.java:
    Code (Java):
    package me.mattio12123.CustomHelp;

    import org.bukkit.plugin.java.JavaPlugin;

    public class CustomHelp extends JavaPlugin {

    }
     
    this is plugin.yml file:

    Code (YAML):
    name: CustomHelp
    author
    : Mattio12123
    version
    : 1.0
    main
    : me.mattio12123.CustomHelp.CustomHelp
    description
    : Custom help command for your server
     
  8. how i import bukkit libraries?
    with shortcut
     
  9. Right click project -> Build path -> Configure Build path -> libraries -> Add External Jars

    Select the jar downloaded from Bukkit.
     
  10. upload_2021-7-27_18-31-59.png
    upload_2021-7-27_18-32-18.png
    upload_2021-7-27_18-32-46.png

    it enable and disable messages doesn't work..