Solved Bukkit Plugin not loading

Discussion in 'Plugin Development' started by rbrick, Sep 25, 2013.

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

    rbrick

    so i wrote a plugin(my first plugin) and i start my server and the first thing i see is a a error message saying my plugin could not be loaded(it also said this with factions for some reason...) so i checked out my code and every thing seemed to check out. if anyone could help that will be fantastic!

    The Code:
    Show Spoiler
    Code:java
    1. package rbrick.custom.recipes;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.Material;
    5. import org.bukkit.inventory.ItemStack;
    6. import org.bukkit.inventory.ShapedRecipe;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9. public class customRecipes extends JavaPlugin {
    10. //This is what happens onEnable
    11. public void onEnable(){
    12.  
    13. ShapedRecipe goldenapple = new ShapedRecipe(new ItemStack(Material.GOLDEN_APPLE ,'1'));
    14. goldenapple.shape("GGG","GDG","GGG");
    15. goldenapple.setIngredient('G', Material.GOLDEN_APPLE);
    16. goldenapple.setIngredient('D', Material.DIAMOND_BLOCK);
    17.  
    18. Bukkit.getServer().addRecipe(goldenapple);
    19.  
    20. }
    21.  
    22. }
    23.  


    The Error:
    Show Spoiler

    2013-09-24 19:46:04 [SEVERE] Could not load 'plugins\CustomRecipes.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: rbrick.custom.recipes
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugins(CraftServer.java:239)
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.<init>(CraftServer.java:217)
    at net.minecraft.server.v1_6_R3.PlayerList.<init>(PlayerList.java:56)
    at net.minecraft.server.v1_6_R3.DedicatedPlayerList.<init>(SourceFile:11)
    at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:107)
    at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393)
    at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    Caused by: java.lang.ClassNotFoundException: rbrick.custom.recipes
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
    ... 9 more

    =================================================================

    if this isn't the thread to post it on then please tell me :)
     
  2. Offline

    adam753

    That error normally means one of two things:
    1: The "main" line in your plugin.yml is wrong. Make sure that all the class names and package names (if any) are correct. It is all case-sensitive.
    2: You checked the wrong boxes when exporting your plugin (assuming you're using Eclipse.) It should look like this:
    Show Spoiler

    [​IMG]
     
  3. Offline

    amhokies

    The plugin is looking for the main class at rbrick.custom.recipes which is the name of your package, but you need to add the main class to the end, so in plugin.yml, it should read "main: rbrick.custom.recipes.customRecipes"
     
  4. Offline

    rbrick

    thank you it is now working.
     
Thread Status:
Not open for further replies.

Share This Page