Skip to main content
Early Access: MineXHost is live and still being built. Expect maintenance and occasional outages. Check live status

“Unable to access jarfile”, “no main manifest attribute” and “Could not find or load main class” on a Minecraft server

Updated 8 min read By MineXHost

These messages come from Java itself, before Minecraft or any mod has run. Java was told to start a jar file and could not: the file is not where the command says, it is not a runnable server jar, or it is damaged. The fix is in the start command or the files beside it, and your world is never involved.

Which message did you get?

What the console saysWhat it meansCheck first
Error: Unable to access jarfile <name>Java cannot find or open the file the command names.The file name in your start command, and whether the file is in the folder the command runs from.
no main manifest attribute, in <name>The file is a jar, but not one Java can start on its own: usually a mod, a library or an installer, not a server.Point the command at the real server jar, or use the loader's start script.
Error: Could not find or load main class <name>Java could not load the class it was asked to start.A missing -jar, an unquoted path with spaces, or an incomplete loader install.
Error: Invalid or corrupt jarfile <name>The file exists but is not a readable jar.Download that file again.

Note

None of these reach your world. Java stops before Minecraft starts, so nothing was loaded or saved, and the whole fix is in the start command or the jar files.

Unable to access jarfile

Java looked for the file named after -jar and could not open it. The common reasons:

  • The name is different. Server jars usually carry a version in their name, so a command that says server.jar fails when the file is called something longer. Copy the exact name from the folder.
  • The command runs from a different folder. A relative file name is looked up in the folder the command is started from, so a script launched from somewhere else cannot see a jar sitting next to it.
  • Windows is hiding the extension. A file renamed to server.jar with extensions hidden can really be server.jar.jar. Turn on file name extensions and check.
  • NeoForge and modern Forge do not start from a single server jar. Their installer writes run.sh and run.bat scripts that hand Java an argument file instead. Start the server with those scripts; an old command that names a Forge jar fails with this message.

no main manifest attribute

A jar that Java can start on its own names its starting class in a manifest file inside it. Mods, libraries and installer leftovers do not, so pointing the start command at one of them gives this message. It usually means a mod or library jar was renamed or copied to the name the start command expects. Point the command at the real server jar, or use the start script the loader's installer created.

Could not find or load main class

Java's command line has two forms: java followed by options and a class name, or java followed by options, -jar and a jar file. Mix them up and Java treats a file name as a class name.

  • -jar is missing. java -Xmx4G server.jar asks for a class called server.jar; java -Xmx4G -jar server.jar starts the jar.
  • A path contains spaces and is not in quotes, so Java reads the second half of the path as the class to start. Quote the path, or move the server to a folder without spaces.
  • The loader install is incomplete. The jar names a starting class in a library that was never installed. Run the loader's installer again in that folder.

Tip

Java options such as -Xmx and -Xms go before -jar. Anything after the jar's file name is passed to Minecraft, not to Java.

Invalid or corrupt jarfile

The file is there but is not a readable jar: a download that stopped part way, a file saved as a web page, or an upload that was cut short. Compare its size with the source and download it again. When the damaged file is a mod rather than the server jar, the crash usually names it, often with a ZipException or zip END header not found.

How to fix it

  1. Open the folder and copy the exact file name of the server jar or the start script.
  2. Run the start command from that folder, or use a script saved in it.
  3. Check the command: Java options first, then -jar, then the file name, with quotes around any path that contains spaces.
  4. For NeoForge or modern Forge, use the run.sh or run.bat the installer wrote, and set memory in user_jvm_args.txt.
  5. If the jar is damaged or the loader install looks incomplete, download the file again or rerun the installer.

Another startup failure that has nothing to do with your mods: the server starts but cannot take its port.

Read the FAILED TO BIND TO PORT guide

What MineXHost's launcher does with this crash

On MineXHost you never write a start command. MineXEngine, our launcher, decides what to start from the files on disk, in order: an argument file that a Forge or NeoForge install created, a server jar the server is configured with, a jar matching a known server-jar name, and only then a plain server.jar. That last step is skipped on Forge and NeoForge, and on Fabric or Quilt when the mods folder has mods in it, so a leftover vanilla jar does not start a modpack without its mods.

If Java still reports Unable to access jarfile, the engine looks for the missing file before giving up. A missing argument file is searched for elsewhere in the server folder; library jars the argument file names but that are missing are copied back from the libraries folder; and if neither works and a Forge or NeoForge installer is already in the folder, the engine runs that installer's server install and tries again. It does not download an installer itself, and when it searches the server folder it skips hidden folders, including the ones it moved files into.

For no main manifest attribute and Could not find or load main class, the engine treats the error as the wrong jar being started. It moves jars at the top of the server folder that have no starting class into a dated folder under .mx-quarantine, where you can get them back, then sets up the server jar again and retries.

A corrupt jar in the mods folder is handled identify-only on a customer server. The engine names the file in your console as one to download again or remove, and leaves it where it is. Each of these recoveries is tried a limited number of times before the engine stops and reports the crash.

Not every pack boots on a server. Our test results page shows how many public modpacks pass on each MineXEngine version, and how they were tested.

See the modpack test results

MineXHost runs Forge, NeoForge, Fabric and Paper servers on MineXEngine. Our launcher detects the modpack, picks the right Minecraft loader and Java version, tunes the JVM for your RAM, and auto-recovers from the crashes that normally end a modded server's evening. Pick your RAM, paste the pack, and play.

See hosting plans

Frequently asked questions

What does “Error: Unable to access jarfile” mean?

Error: Unable to access jarfile means Java could not find or open the jar file named after -jar in the start command, so the server never started. Usually the file name in the command differs from the real file, the command runs from another folder, or Windows hid a second .jar extension. On NeoForge and modern Forge, start the server with the run.sh or run.bat script the installer created instead.

How do I fix “no main manifest attribute, in server.jar”?

The no main manifest attribute message means the jar you started is not a runnable server jar: it has no starting class in its manifest, which is normal for a mod, a library or an installer leftover. Point the start command at the real server jar, or use the start script your loader's installer created, rather than renaming another jar to server.jar.

Why does Java say “Could not find or load main class” when I start my server?

Java says Could not find or load main class when it was asked to start a class it cannot load, which for a Minecraft server usually means -jar is missing from the command, so Java treats the jar's file name as a class name. An unquoted path containing spaces, or a loader install that never finished, causes the same message. Put Java options first, then -jar and the file name.

What causes “Invalid or corrupt jarfile” on a Minecraft server?

Invalid or corrupt jarfile means the file exists but Java cannot read it as a jar, usually because a download or upload stopped part way or a web page was saved under a jar's name. Compare the file's size with the source and download it again. For a damaged mod, the crash usually names the file next to a ZipException.

Do I need a start script or server.jar on MineXHost?

MineXHost servers need no start script or server.jar written by you, because MineXEngine decides what to start from the files the install put on disk, beginning with the argument file a Forge or NeoForge install creates. If Java still cannot open the file, the engine searches the server folder for it, restores missing library jars, and reports the crash if that fails.

Still stuck?

Every ticket is answered by a real person who plays Minecraft and knows modpacks. Send the full console output, not just the last line. Customers open a ticket from the panel; anyone can ask in our Discord.

  • Live support 5PM-12AM ET on weekdays
  • Replies typically within 12 hours
  • Limited availability on weekends