Cannot Find Main Class

Discussion in 'Spigot Plugin Help' started by tommy099431, Jun 15, 2016.

  1. Hello,
    Im testing some plugins that I created on my server although whenever I do /pl nothing so up so I go into the console and find this error
    Code (Text):
    [08:50:12 ERROR]: Could not load 'plugins\AppleSeeds.jar' in folder 'plugins
    '
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.Main.AppleSeeds'

    I have tried this for my plugin.yml
    Code (Text):
    name: AppleSeeds
    main: me.main.AppleSeeds
    version: 9.7.2.6.13.16
    author: cows_451 | Spigot tommy099431
    description: Let players have appleseeds!

    Does anyone know why? Thanks, I can show the full error code if you like
     
  2. Try
    Code (Text):
    name: AppleSeeds
    main: me.main.AppleSeeds.<MainClassName>
    version: 9.7.2.6.13.16
    author: cows_451 | Spigot tommy099431
    description: Let players have appleseeds!
    Edit: Actually, can you post a print screen of your plugin's tree?
     
  3. Thats an example for one of my plugins that is also not working
     
  4. This also just started to happen to me when I updated them to 1.9.4
     
  5. try me.Main.AnvilRepair.Main
     
    • Like Like x 1
  6. ^^
     
    • Like Like x 1
  7. So if your package name is

    me.athena222.main

    and your Main Class is "Main", your plugin.yml should contain

    main: me.athena222.main.Main

    Does that make sense?

    Edit: Whoops, didn't see the two posts above. They're probably right. But-
    1. I think its easier to leave your package lowercase, most developers do this.
    2. (Optional) Package names aren't normally plugin names. If you want to, sure, but like I said, me.athena222.main - or if you have a website, for example com.athena222.dev, i've even seen people put in their github sometimes.
     
    • Like Like x 1
  8. Seems like its working! Thanks for helping me out!
     
    • Like Like x 1
  9. Capitals matter. :) Make sure all casing on the letters match. :)
     
  10. the main: needs to refer to your mian class
    the one that extends JavaPlugin

    the class AppleSeeds does not exist in your code