"Cannot find or load main class" w/ Linux

Discussion in 'Plugin Development' started by maklegend, Jan 11, 2020.

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

    maklegend

    I've been running my server fine with the traditional linux start command:

    java Xmx10G -jar server.jar -o true

    However, due to the plugin I'm developing, I need to load my server at the same time the main class of bukkit is loaded (a Snowflake database driver). I am attempting to do so via the following command:

    java -classpath "spigot-1.15.1.jar;lib/*" org.bukkit.craftbukkit.Main

    This command works fine on my local machine. I have replicated all the files accordingly on the linux box as well, so this command should work. Despite this, I am met with the error:

    [root@ded501 mcnations]# java -classpath "spigot-1.15.1.jar;lib/*" org.bukkit.craftbukkit.Main
    Error: Could not find or load main class org.bukkit.craftbukkit.Main

    Any help for how to rectify this and still load the driver class (located in my lib directory) is much appreciated.
     
  2. Offline

    drew6017

    This is the main class for the spigot server as detailed by the jar's manifest. Meaning org.bukkit.craftbukkit.Main will always be loaded first and contains the main() method called during entry. You do not have to specify it manually. As for loading the database driver, you need to include it in your plugin by just combining the files of the jars (these are called fat jars). If you plan on distributing this plugin, however, do not do this because of namespace conflicts.
     
Thread Status:
Not open for further replies.

Share This Page