Missing Main Class

The server will not start because Java cannot find the main class to run. The launch command points at the wrong file, or the jar does not contain the expected entry point.

What does this error mean?
Java needs a main class to begin execution. 'Could not find main class' means either you launched the wrong jar (an installer instead of the server, for example) or the start command's class/jar reference is incorrect.
Could not find main class
Most Common Causes
  • Running an installer jar instead of the server jar.
  • A wrong filename in the start command.
  • A corrupted jar missing its manifest.
  • Using '-cp' with an incorrect class path.
  • A renamed jar that no longer matches the command.
How To Diagnose
  1. Check exactly which jar your start command runs.
  2. Confirm it is the server jar, not an installer or library.
  3. Inspect the jar's manifest for a Main-Class entry.
  4. Verify the filename in the command matches the actual file.
Recommended Fixes
  • Launch the correct jar
    Point the start command at the actual server jar produced by the installer.
  • Run the installer first
    For Forge/NeoForge, run the installer to generate the proper server files, then launch those.
  • Fix the start command
    Use 'java -jar server.jar' with the right filename, or the correct -cp/main class.
  • Re-download a clean jar
    Replace a jar with a missing manifest with a fresh download.
Frequently Asked Questions

Forge/NeoForge ship an installer that, when run, produces the actual server files you launch.

Open the jar's META-INF/MANIFEST.MF, it lists the Main-Class entry.

Your start command still references the old name, update it to the new filename.