Problem loading my plugin

Discussion in 'Plugin Development' started by FrancescoTG, Mar 27, 2012.

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

    FrancescoTG

    Hi.
    I've tried to create a simple plugin wtih eclipse, but when I place the exported JAR file into 'server\plugins' folder and I start my server, craftbukkit says:
    How can I solve this problem?
    Thanks for your help.
     
  2. Offline

    dsmyth1915

    Caused by: java.lang.ClassNotFoundException: com.github.francescotg.plugin
    What does your plugin.yml say for "main:~~~~"?
     
  3. Offline

    Father Of Time

    As stated above, you did not point java to your main class properly in your plugin.yml.

    provide us with your plugin.yml and the project build path and we may be able to assist you.
     
  4. Offline

    FrancescoTG

    Here you my plugin.yml:
    Code:
    name: Plugin
    version: 0.1
    description: Control the world weather.
    author: BLG Corporation
    authors: [FrancescoTG]
    website: http://www.blgcorporation.it
    main:  com.github.francescotg.plugin
    database: false
    depend:
     
    commands:
      rain:
        description: Set weather to rain.
        aliases: [i_rain, irain]
        permission: iweather.rain
        usage: Syntax error! Simply type /<command> to set weather to rain.
      sun:
        description: Set weather to rain.
        aliases: [i_sun, isun]
        permission: iweather.sun
        usage: Syntax error! Simply type /<command> to set weather to sun.
      snow:
        description: Set weather to snowfall.
        aliases: [i_snow, isnow]
        permission: iweather.snow
        usage: Syntax error! Simply type /<command> to set weather to snow.
    permissions:
      iweather.*:
        description: Gives access to all iWeather commands
        children:
          iweather.rain: true
          iweather.sun: true
          iweather.snow: true
      iweather.sun:
        description: Gives access to iWeather sun command
        children:
      iweather.rain:
        description: Gives access to iWeather rain command
        children:
      iweather.snow:
        description: Gives access to iWeather snow command
        children:
    Thanks for your quick reply! :D
     
  5. Offline

    Superkabii

    This should be the package name + name of your class extending JavaPlugin.
     
  6. Offline

    FrancescoTG

    I've done it, but it DOESN'TWORK!!! Why?
    Thanks for your support.
     
  7. Offline

    nisovin

    What is your package and main class name?
     
  8. Offline

    jamietech

    You have two spaces after
    Code:
    main:
    You're gonna need to remove one so it's
    Code:
    main: com.github.francesotg.plugin
     
  9. Offline

    Mr Washington

    It is case sensitive, if your main class is Plugin not plugin make sure your main thing reads: com.github.francescotg.Plugin
     
  10. Offline

    FrancescoTG

    Tha package name is 'com.github.francescotg.plugin' and the class name is 'Plugin'.
    I checked plugin.yml, but there is only one space.
    I checked my plugin.yml and now it is:
    Code:
    ...
    main: com.gitub.francescotg.plugin.Plugin
    Where is the error???
     
  11. Offline

    Mr Washington

    What class's are you using? Also please paste the source of your main class in a spoiler below!
     
  12. Offline

    stuntguy3000

    Where is the error???

    main: com.gitub.francescotg.plugin.Plugin



    The error WAS that it was failing to access your class file :)
     
  13. Offline

    nisovin

    It should be:

    Code:
    com.github.francescotg.plugin.Plugin
     
  14. Offline

    CorrieKay

    If youre using Eclipse, didja clean your build?
     
  15. Offline

    dsmyth1915

    ... You misspelled "github"
     
    CorrieKay likes this.
  16. Offline

    FrancescoTG

    I tried to change package and class names tp avoid mispellings, and now I've this:
    [​IMG]

    I also changed plugin.yml:
    Code:
    ...
    main: com.gmail.francescotg6.iweather.iWeather
    ...
    ...but this didn't solve the problem!
    What does go wrong?
    How do I clean my build with Eclipse?
     
  17. Well, I have sometimes the same problem that a class couldn't be found if it has warnings. So try to get rid of them.
     
  18. Offline

    FrancescoTG

    I succeeded in deleting warnings, but this didn't solve the error.
    What can I do?
     
  19. Offline

    SirTyler

    change main to: com.gmail.francescotg6.iWeather

    the reason is that your package is only com.gmaifrancescotg6, there is no package called iweather so you need to remove that and add only the name of the main class.
     
  20. Offline

    dsmyth1915

    With your current build path it should be

    com.gmail.francescotg6.iWeather

    Use that and you should be good.
     
  21. Offline

    FrancescoTG

    I tried but CB says:
    Anyway, I forgot to tell you that in iWeather.jar I've only:
    [​IMG]
    ...without package and classes? Why?

    I finally solved my problem exporting package and class files with eclipse.
    Thanks very much for all your support!!! :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  22. Offline

    dsmyth1915

    Your welcome, come back anytime :)
     
Thread Status:
Not open for further replies.

Share This Page