"Jar does not contain plugin.yml" when jar contains plugin.yml

Discussion in 'Plugin Development' started by Thom1729, Sep 26, 2012.

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


    My first plugin. Doing something minimal (adding a chiseled stone recipe) for a first project. The error:

    2012-09-26 22:21:49 [SEVERE] Could not load 'plugins/ChiseledStoneBlockRecipe.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:198)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:222)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198)
        at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50)
        at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
        at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:378)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 9 more
    The structure of the jar:


    name: ChiseledStoneBlockRecipe
    main: net.sarpathia.ChiseledStoneBlockRecipe.Main
    version: 1.0

    package net.sarpathia.ChiseledStoneBlockRecipe;
    import org.bukkit.Material;
    import org.bukkit.inventory.*;
    import org.bukkit.plugin.java.JavaPlugin;
    public class Main extends JavaPlugin {
        public void onEnable() {
            getLogger().info("Loading Chiseled Stone Block Recipe.");
            ShapedRecipe recipe = new ShapedRecipe(new ItemStack(Material.SMOOTH_BRICK, 8, (short)3));
            recipe.shape("AAA", "A A", "AAA");
            recipe.setIngredient('A', Material.SMOOTH_BRICK, 0);
  2. Offline


    Refresh the file in your IDE
  3. Offline


    A couple things.... Change the plugin name PLEASE! Your plugin's code will look MUCH better if you follow standard convention of naming programs and use short names! (not required just recommended)

    2nd: What IDE are you using?

    If(IDE == Eclipse){
    System.out.println("Make sure the plugin.yml folder is inside the SRC folder and NOT outside of it. This happened to me one time before.");
    System.out.println("What IDE are you useing");

    (yes i was bored and a pun was intended by putting my reply in a snippet of code.)
  4. Offline


    make sure the plugin.yml is located in the first folder of the project so you right click project then new file then plugin.yml then edit it right click on project refresh then right click export!
  5. Offline


    It tells you what's wrong at the beginning and the end.
    [SEVERE] Could not load 'plugins/ChiseledStoneBlockRecipe.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
    Make sure that your plugin.yml is located at the same place where your net folder would be in the .jar file.
    Your .jar structure should be:
    The asterisks represent how many levels in the .jar file they are.
  6. Offline


    Umm.. none of my plugin.yml's are in the src folder of my plugins..
  7. Offline

    Lolmewn Retired Staff

    Problem is that the plugin.yml doesn't have a plugin description.
  8. Offline


    here is how i always get it right:
    Project name:
    I have never had any luck with putting it in a package so i always put it in side src.

    Some Steps you should take:

    1. Save the plugin.yml
    2. Refresh The IDE (right click in the project explorer and click refresh or hit F5)
    3. ???
    4. Profit
  9. Offline


    The description for a plugin is not necessary.
  10. Offline

    Lolmewn Retired Staff

    Oh yeah, you're right. Never mind!
  11. Offline


    The test I posted is from the 'plugin.yml' in the jar itself.

    Eclipse, although what should matter is the jar itself.

    There is no 'src' folder in the jar. Should there be?

    That's where it was, which is why it ended up at the root level of the jar.

    That's where my 'plugin.yml' is. I tried the structure you suggest for the class file, but received the same error.
  12. Offline


    Im sorry I was tired the plugin.yml folder should be inside the package. Also are you coding this plugin or installing it? If you are installing it then contact the developer unless you know how to decompile the code. (No its not illegal to decompile code unless you claim its yours.)

    I see whats wrong now! move plugin.yml to the same level as your main class!
  13. Offline


    I coded exactly the way you did. With the plugin.yml file exactly where I said it should be. Works perfectly for me.
  14. Offline


    Double check to make sure that there are no indents in the plugin.yml file.
    EDIT: I noticed you said there is no src folder. When you go to compile the plugin, it should look like this: http://gyazo.com/3d8c2fd6267765f99e4882ab4cbb06c2
    Of course the names of projects/packages don't matter, this is just what I could I open at the time.
Thread Status:
Not open for further replies.

Share This Page