Minecraft Server Jar Not Opening or Not Creating Files

Updated · MCJarHub

Double-clicking a server jar hides every error message. Open a terminal in the server folder and run java -jar server.jar nogui — the text it prints tells you which of the fixes below applies.

First: start it from a terminal, not by double-clicking

A Minecraft server is a console program. Double-clicking the jar either does nothing visible, opens it as an archive, or flashes a window that closes before you can read anything. Start it from a terminal in the server folder so you can see what it says:

cd path/to/your/server-folder
java -Xms2G -Xmx2G -jar server.jar nogui

Windows: open the folder in Explorer, type cmd in the address bar and press Enter. macOS/Linux: open Terminal and cd into the folder. Use the real file name of your jar (e.g. paper-1.21.11-132.jar). Then match the output to one of the causes below.

1. "'java' is not recognized" / "java: command not found"

Java is not installed, or not on your PATH. The exact messages are:

  • Windows: 'java' is not recognized as an internal or external command, operable program or batch file.
  • Linux: java: command not found
  • macOS: The operation couldn’t be completed. Unable to locate a Java Runtime.

Install the Java version your Minecraft version needs — see which Java version for which Minecraft version — then open a new terminal and check with java -version. The Minecraft launcher's built-in Java does not count; the server needs its own.

2. It starts, then stops after a few seconds

On the very first start this is normal. The server creates eula.txt, server.properties and a logs folder, prints You need to agree to the EULA in order to run the server. Go to eula.txt for more info. and exits. Set eula=true in eula.txt and start it again — details in the EULA fix.

3. "UnsupportedClassVersionError" or "A Java Exception has occurred"

Your Java is older than the jar needs. The message contains class file version 65.0 or similar; 61 = Java 17, 65 = Java 21, 69 = Java 25. Follow the UnsupportedClassVersionError fix. On Windows, a double-clicked jar only shows the popup described in "A Java Exception has occurred".

4. "Unable to access jarfile" or "Invalid or corrupt jarfile"

  • Error: Unable to access jarfile server.jar — the name in the command does not match the file, or you are in the wrong folder. Windows hides known file extensions, so a file shown as server.jar may really be server.jar.jar; run dir (Windows) or ls (macOS/Linux) to see the real name.
  • Error: Invalid or corrupt jarfile server.jar — the download is incomplete, or you saved a web page instead of the file. Download it again and compare its checksum with the one shown on the version page (how to verify a jar).

5. It runs, but no files appear

The server writes its files into the working directory — the folder the command was started from — not the folder the jar sits in. If you ran java -jar C:\mc\server.jar from your home folder, the files are in your home folder. Put a start script next to the jar that changes into its own folder first:

REM start.bat (Windows)
cd /d "%~dp0"
java -Xms2G -Xmx2G -jar server.jar nogui
pause

# start.sh (macOS/Linux) — make it executable once: chmod +x start.sh
cd "$(dirname "$0")"
java -Xms2G -Xmx2G -jar server.jar nogui

Also check that the folder is writable: servers placed in C:\Program Files or a synced cloud folder often fail to create files.

6. The window opens and closes instantly

The start script ran into one of the errors above and the window closed before you could read it. Add pause as the last line of start.bat, or run the script from an already open terminal. The full log is also in logs/latest.log once the server got far enough to create it.

7. You expected a window or a GUI

With nogui the server has no window — it runs in the terminal, and you type commands like stop there. Without nogui the vanilla server opens a small status window. Proxies (Velocity, BungeeCord) never have a GUI. Either way, players connect with the Minecraft client to localhost (same PC) or your IP address.

Still stuck?

Check logs/latest.log for the first line containing ERROR or Exception — that line names the cause. Other common start-up errors: "FAILED TO BIND TO PORT" (port already in use). For a clean start from scratch, follow how to run a Minecraft server jar or generate a ready-made script with the start script generator.

FAQ

Why does the jar open in WinRAR or 7-Zip?
A .jar is a zip archive, so an archive program registered for .jar opens it. Start the server with a java -jar command or a start script instead of double-clicking.
Where are the server files created?
In the current working directory — the folder you start java from, not necessarily the folder the jar is in. Start scripts that cd into their own folder avoid this.
The window opens and closes immediately — how do I see the error?
Add a pause line at the end of start.bat (Windows) or run the command in an already open terminal, so the output stays on screen.