How to Fix Common Minecraft Java Errors
By PickaxeKit Editorial Team · Updated 2026-11-08
Most Java errors mean the wrong Java version or a wrong file path. Minecraft 26.3 needs Java 25; install it, then run the server with that Java.
UnsupportedClassVersionError
This means your Java is older than the Minecraft version needs. The error shows a class file version number. Match it to Java with this table, then install that Java from the Java guide.
| Class file version in the error | Java needed |
|---|---|
| 52 | Java 8 |
| 60 | Java 16 |
| 61 | Java 17 |
| 65 | Java 21 |
| 69 | Java 25 |
'java' is not recognized as a command
Java is installed but not on your PATH, or not installed at all. Reinstall Java and tick the option to add it to PATH, then open a new terminal. Or run Java with its full path.
Error: Unable to access jarfile
- The file name in your command does not match the real file (for example server.jar vs minecraft_server.jar).
- The terminal is in a different folder. Open it inside the server folder, or use the full path to the jar.
- Windows hides file extensions, so the file may really be server.jar.jar. Turn on file name extensions to check.
Could not reserve enough space for object heap
The -Xmx value asks for more memory than Java can get. Lower it (for example -Xmx2G), and make sure you installed 64-bit Java: 32-bit Java can only use a small amount of memory.
Which Java goes with which Minecraft
| Minecraft | Java |
|---|---|
| 26.1 to 26.3 | Java 25 |
| 1.20.5 to 1.21.11 | Java 21 |
| 1.18 to 1.20.4 | Java 17 |
| 1.17 to 1.17.1 | Java 16 |
| 1.0 to 1.16.5 | Java 8 |