NoClassDefFoundError with my own external jar

Discussion in 'Plugin Development' started by Rixterz, Sep 3, 2018.

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

    Rixterz

    Hi,

    I have a main jar, called MCServerMain.jar, and other called DatabaseManager.jar. MCServerMain uses DatabaseManager. There are no errors in either; both export OK. Both are in the plugins folder.

    DatabaseManager is in MCServerMain's build path as an external jar. What could be causing this error?

    Code:
    java.lang.NoClassDefFoundError: antirix/databasemanager/main/DatabaseManager
    One thing to note is that DatabaseManager doesn't have a plugin.yml - I don't know whether it needs it or not. It's not a plugin, as it doesn't run standalone, it's only referenced.
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    Rixterz

    Thanks for your reply, but now I have a different error:

    [17:37:06 ERROR]: Could not load 'plugins\DatabaseManager.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: main class `antirix.databasemanager.main.DatabaseManager' does not extend JavaPlugin

    I don't want it to be a JavaPlugin. All I'm doing is referencing some methods from DatabaseManager in the main jar. Can't I just have it as a library?

    I'd also rather have it in a separate folder, plugins/lib, but I get the same issue as before.
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Rixterz Decompile BackupLikeMe, it has some jar loading in the main class.
     
    sebcio98 likes this.
Thread Status:
Not open for further replies.

Share This Page