Discussion in 'Plugin Development' started by Set3, Jun 21, 2016.

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


    So I'm trying to write a plugin, and I'm very new to java development. I am trying to understand why I'm getting a ClassNotFoundException. Heres the error message:
    [19:58:54 ERROR]: Could not load 'plugins/AdvMute.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `'
        at<init>( ~[spigot.jar:git-Spigot-798f32d-0cd0397]
        at ~[spigot.jar:git-Spigot-798f32d-0cd0397]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin( ~[spigot.jar:git-Spigot-798f32d-0cd0397]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins( [spigot.jar:git-Spigot-798f32d-0cd0397]
        at org.bukkit.craftbukkit.v1_9_R2.CraftServer.loadPlugins( [spigot.jar:git-Spigot-798f32d-0cd0397]
        at net.minecraft.server.v1_9_R2.DedicatedServer.init( [spigot.jar:git-Spigot-798f32d-0cd0397]
        at [spigot.jar:git-Spigot-798f32d-0cd0397]
        at [?:1.8.0_92]
    Caused by: java.lang.ClassNotFoundException:
        at ~[?:1.8.0_92]
        at ~[spigot.jar:git-Spigot-798f32d-0cd0397]
        at ~[spigot.jar:git-Spigot-798f32d-0cd0397]
        at java.lang.ClassLoader.loadClass( ~[?:1.8.0_92]
        at java.lang.ClassLoader.loadClass( ~[?:1.8.0_92]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_92]
        at java.lang.Class.forName( ~[?:1.8.0_92]
        at<init>( ~[spigot.jar:git-Spigot-798f32d-0cd0397]
       ... 7 more
    Here's the class:
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.entity.Player;
    public class AdvancedMute extends JavaPlugin{
        public void onEnable() {
            this.getCommand("votemute").setExecutor((CommandExecutor) new VoteMuteCommand());
    name: AdvMute
    version: 0.1
    author: [email protected]
    description: advanced mute commands
            description: Starts a vote to temp mute a player
            usage: /votemute <player>
    I understand this should be really simple to fix, but I'm really struggling to see what I'm doing wrong...
  2. Offline

    CeramicTitan Retired Staff

    This makes no sense.

    Can you show your project hierarchy via screenshot pls? @Set3
    Last edited: Jun 21, 2016
  3. Offline


    Sorry forgot to include that:
    Screen Shot 2016-06-21 at 9.16.27 PM.png
    Last edited: Jun 21, 2016
  4. Offline


    Are you sure you packaged it correctly? Try opening up your .jar file with Winrar or 7zip and see if the main class is in the correct path.
  5. Offline

    CeramicTitan Retired Staff

    @Set3 Have you ever used maven before? Because I think your issue may be a pom issue or a build issue.
    Last edited: Jun 22, 2016
    bwfcwalshy likes this.
Thread Status:
Not open for further replies.

Share This Page