Development Assistance Could not find main class error

Discussion in 'Plugin Help/Development/Requests' started by TehGamingBlock, Nov 10, 2016.

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


    So I have been looking at various threads on this problem and noone seems to have an answer that solves the problem I have. I wrote my first plugin a few days ago, and have wrote a few since, and for each one of them the same error message pops up,
    Loading libraries, please wait...
    [11:17:51 INFO]: Starting minecraft server version 1.10.2
    [11:17:51 INFO]: Loading properties
    [11:17:51 INFO]: Default game type: SURVIVAL
    [11:17:51 INFO]: Generating keypair
    [11:17:52 INFO]: Starting Minecraft server on *:25565
    [11:17:52 INFO]: Using default channel type
    [11:17:53 INFO]: This server is running CraftBukkit version git-Bukkit-33071ec (
    MC: 1.10.2) (Implementing API version 1.10.2-R0.1-SNAPSHOT)
    [11:17:54 ERROR]: Could not load 'plugins\FirstPlugin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.tehgamingbl
    a:42) ~[craftbukkit.jar:git-Bukkit-33071ec]
    ava:127) ~[craftbukkit.jar:git-Bukkit-33071ec]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:328) ~[craftbukkit.jar:git-Bukkit-33071ec]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) [craftbukkit.jar:git-Bukkit-33071ec]
            at org.bukkit.craftbukkit.v1_10_R1.CraftServer.loadPlugins(CraftServer.j
    ava:295) [craftbukkit.jar:git-Bukkit-33071ec]
            at org.bukkit.craftbukkit.v1_10_R1.CraftServer.<init>(
    57) [craftbukkit.jar:git-Bukkit-33071ec]
            at net.minecraft.server.v1_10_R1.PlayerList.<init>( [
            at net.minecraft.server.v1_10_R1.DedicatedPlayerList.<init>(SourceFile:1
    4) [craftbukkit.jar:git-Bukkit-33071ec]
            at net.minecraft.server.v1_10_R1.DedicatedServer.init(DedicatedServer.ja
    va:184) [craftbukkit.jar:git-Bukkit-33071ec]
    a:514) [craftbukkit.jar:git-Bukkit-33071ec]
            at Source) [?:1.8.0_111]
    Caused by: java.lang.ClassNotFoundException: me.tehgamingblock.bukkitplugin
            at Source) ~[?:1.8.0_111]
    java:77) ~[craftbukkit.jar:git-Bukkit-33071ec]
    java:62) ~[craftbukkit.jar:git-Bukkit-33071ec]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_111]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_111]
            at java.lang.Class.forName0(Native Method) ~[?:1.8.0_111]
            at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_111]
    a:40) ~[craftbukkit.jar:git-Bukkit-33071ec]
            ... 10 more
    That's the console error message. Here is the plugin.yml:
    name: bukkitplugin
    main: me.tehgamingblock.bukkitplugin
    version: 1.0
          description: Blank description.
          usage: /<command>
    The main class:
    package me.tehgamingblock.bukkitplugin ;
    import java.util.logging.Logger;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.PluginDescriptionFile;
    public class bukkitplugin extends JavaPlugin {
        public final Logger logger = Logger.getLogger("Minecraft");
    public void onEnable(){
        PluginDescriptionFile pdfile = this.getDescription(); + "Has been enabled!");
    public void onDisable(){
        PluginDescriptionFile pdfile = this.getDescription();
   + "Has been disabled!");
    public boolean onCommand(Command cmd, CommandSender sender, String label, String[] args){
        if(cmd.getName().equalsIgnoreCase("hi") && sender instanceof Player){
            Player p = (Player) sender;
            p.sendMessage("Hi, " + p.getName() + "!");
            return true;
        return false;
    Very basic plugin, I know. There are no errors in the class and I have tried a few things to solve this:
    Moved plugin.yml into src folder
    Changed package multiple times to different configs
    Added Author and Description.

    Please let me know of anything else I can do to fix it. A screenshot of eclipse is linked as well.

    Attached Files:

  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline


    class name? I thought that was the '.bukkitplugin' part of it.
    Last edited by a moderator: Nov 10, 2016
  4. Offline

    timtower Administrator Administrator Moderator

    @TehGamingBlock Do note that you also have .bukkitplugin in your package already.
  5. Offline


    If your class name is bukkitplugin, then you remove that from the package name.... plugin.yml should work fine afterwards :\
  6. Offline

    timtower Administrator Administrator Moderator

    @Side8StarLite Package names should try to keep a format though which would break with your suggestion.
  7. Offline


    Thanks for the help, I have it now. Somehow I managed to try every combination OTHER than the right one, which is frustrating.
Thread Status:
Not open for further replies.

Share This Page