Solved [HELP] Java Bukkit Plugin - Cannot find main class - Could not load plugin

Discussion in 'Plugin Development' started by KierBear11, Aug 23, 2014.

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

    KierBear11

    I recently started getting into developing plugins for Bukkit. I have prior knowledge to basic - 1/5 intermediate Java, and to get used to Bukkit, have engaged in many different tutorials. Yet I seem to have a problem that is persistent with everything I have tried... I have even went to the bare minimum for Bukkit plugins, yet it still persists.

    Error Message:


    Could not load 'plugins/TestPlugin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.kieran.testplugin.TestPlugin'

    Full Console Log:

    http://pastebin.com/XNey6iBy

    TestPlugin (Main Class):

    http://pastebin.com/s510Kx1Y

    plugin.yml:

    http://pastebin.com/eN5r11WB

    Screenshot of Package Explorer:

    http://i.imgur.com/hPCofrB

    Thank you,
    Kieran
     
  2. Offline

    Bammerbom

    KierBear11
    Are you sure it is the same jar? Because I really dont see a problem.

    Try re-exporting your jar.
     
  3. Offline

    stoneminer02

    In the package explorer I see the plugin.yml to be inside the java project and not inside the src source.
     
  4. Offline

    Adoma_

    I too recently started Bukkit Plugin developing and had the same problem IDK really the background of your problem is but you just have to change your plugin.yml file its that simple.

    Try this:

    main:
    name:
    version:
    author:
    description:

    ============
    Make sure you imput the right data in the filds and dont inculed the === thing :)


    Sorry Admins Mods and ect if double postin gis not allowed but,
    Make sure the the api docs is on http://jd.bukkit.org/apidocs


    [edit by JaguarJo: merged posts. Just use the edit option next time to add onto your post. :) ]
     
    KierBear11 likes this.
  5. Offline

    KierBear11

    I'm pretty sure its in the same jar file. When I save it as a .zip to look inside the file, I have all the files, and they seem to be in the correct location. But for the name of science, I did try exporting it several times.. with no prevail.

    I don't think you're meant to have the yml file inside the src folder specifically. But I tried just in case! Yet it shows the same error message. (This got me thinking that it isn't a plugin.yml problem like many seem to have)

    I'm thinking that it may not be a problem with the syntax, or the location of the files. But maybe a compiling error of some sort? I checked my java version on both the main computer (the one that runs the server) and the compiler, and they're both Java 7. So, yeah I have no clue... :/


    Wow! It worked perfectly!! Thank you so much for the reply; I guess author and description are mandatory now? Nevertheless thank you, and have a great day! ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  6. Offline

    Adoma_

    Thanks, sorry didnt reply sooner ..
     
Thread Status:
Not open for further replies.

Share This Page