Solved Cannot find class?

Discussion in 'Spigot Plugin Development' started by xImprovable, Apr 26, 2017.

  1. [12:59:53 ERROR]: Could not load 'plugins\ChatClear.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `'
    at<init>( ~[spigot.jar:git-Spigot-38ddb34-c19c293]
    at ~[spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin( ~[spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.craftbukkit.v1_11_R1.CraftServer.loadPlugins( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.craftbukkit.v1_11_R1.CraftServer.reload( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.Bukkit.reload( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.command.defaults.ReloadCommand.execute( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.command.SimpleCommandMap.dispatch( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchServerCommand( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at net.minecraft.server.v1_11_R1.DedicatedServer.aM( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at net.minecraft.server.v1_11_R1.DedicatedServer.D( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at net.minecraft.server.v1_11_R1.MinecraftServer.C( [spigot.jar:git-Spigot-38ddb34-c19c293]
    at [spigot.jar:git-Spigot-38ddb34-c19c293]
    at Source) [?:1.8.0_131]
    Caused by: java.lang.ClassNotFoundException:
    at Source) ~[?:1.8.0_131]
    at ~[spigot.jar:git-Spigot-38ddb34-c19c293]
    at ~[spigot.jar:git-Spigot-38ddb34-c19c293]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_131]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_131]
    at<init>( ~[spigot.jar:git-Spigot-38ddb34-c19c293]
    ... 15 more

    I get this error when I start my server. I made my plugin and I popped it into the plugins folder and I got this message. I dont know what to do. If you want code ect just ask
  2. Yeah I know I dont know what to say?
  3. I dont know what you mean?
  4. Show us your plugin.yml, it should have a main, a name, and a version.
  5. This has nothing to do with dependencies, if you both read the error, your plugin.yml is not pointing to the main class. Either that or your compilation isn't correct and the jar isn't being built properly.

    I linked the thread specifically for the sections "Know your Java" and "Give us sample code + stacktrace"
    • Agree Agree x 2
    • Like Like x 1
    • Winner Winner x 1
  6. Make sure the main class that extends JavaPlugin is called ChatControl, and is under the pacakage name ''. If it is not, there is your issue. Update it in your plugin.yml, or refactor the package/class name to suit.
  7. WAS


    Also, you do not need to depend on a plugin to load before it. There is specifically a loadbefore option for your plugin.yml
  8. loadbefore and depend are polar opposites iirc. loadbefore states that your plugin should load before the plugins listed, while depend states that the plugins listed should load before yours.
    • Agree Agree x 1
  9. WAS


    Right. That's true.