Which Java version does a Minecraft server need?
Minecraft 26.1 and newer needs Java 25, 1.20.5–1.21.11 needs Java 21, 1.18–1.20.4 needs Java 17, and 1.16.5 and older need Java 8. Minecraft Java Edition is written in Java, so the server only starts on the Java version its game version requires – or a newer one.
| Minecraft version | Minimum Java (per Mojang) | What "Auto" uses on Spot.gg |
|---|---|---|
| 26.1, 26.2, 26.3 and newer | Java 25 | Java 25 |
| 1.20.5 – 1.21.11 | Java 21 | Java 21 |
| 1.18 – 1.20.4 | Java 17 | Java 17 |
| 1.17 – 1.17.1 | Java 16 | Java 17 |
| 1.16 – 1.16.5 | Java 8 | Java 11 or 17, depending on the engine |
| 1.15.2 and older | Java 8 | Java 8 (11 for a few engines) |
Two things worth knowing:
- The requirement is a minimum, but newer isn't always better. Vanilla and Paper usually cope with a newer Java, while old modded engines (Forge up to 1.16.5) can crash on a Java newer than the one they were built for.
- Modpacks have their own requirements. A Forge pack for Minecraft 1.20.1 needs Java 17, a NeoForge pack for 1.21.1 needs Java 21, and a pack for 26.1 needs Java 25. Pack authors list this on the pack page, e.g. on CurseForge.
Spot.gg servers come with the long-term support (LTS) releases: Java 8, 11, 17, 21 and 25. In-between releases (such as 16, 18 or 22) no longer get security fixes, so an engine that asks for, say, Java 16 gets the nearest LTS release – Java 17.
How do I change the Java version on my server?
In the Spot.gg panel go to "Configuration" → "Server" tab → "JAVA version", pick a version from the list, click "Save" and restart the server. There's nothing to install or upload – every Java version is already on the server.
- Open your server in the panel and go to "Configuration".
- Pick the "Server" tab.
- In "JAVA version", choose either "Auto (Java 21)" (the number depends on your engine or modpack) or a specific version, e.g. "Java 17".
- Click "Save". A "Saved." message appears under the field, saying the change will take effect after the server restarts.
- Click "Restart now" in that message (or start the server if it was stopped).
The default is "Auto" – the panel matches Java to the installed engine and game version, or to the modpack if you run one. The brackets show which version that is, e.g. "Auto (Java 25)" on a 26.3 server. In the vast majority of cases this is the best setting and you can leave it alone.
Setting Java by hand makes sense when:
- a mod or plugin needs a newer Java than the server runs (e.g. an add-on built for Java 21 on a 1.20.1 server that runs Java 17),
- an old mod breaks on newer Java and its author recommends a specific version,
- you uploaded your own world or server files with requirements different from the selected engine.
If the version you choose differs from the one assigned to the engine or modpack, a red notice about it appears on the "Information" page. If the server then won't start, set "JAVA version" back to "Auto".
Rather not dig through settings? Click "Ask the assistant" – the AI assistant in the panel checks the console to see which Java the server or add-on needs and, once you confirm, changes the Java version for you. All that's left is to restart the server.
What happens to Java when I change the Minecraft version or engine?
When you change the engine or game version via "Information" → "Modify", "JAVA version" goes back to "Auto", so the server gets the Java that fits the new version. For example, moving from Paper 1.21.11 to Paper 26.3 switches Java from 21 to 25 automatically.
If you had set Java by hand (e.g. for a specific mod), check the field again after the update. Before a bigger version jump, make a backup in the "Backups" tab – a world opened in a newer Minecraft version can't be loaded on an older one. More in our guide to Minecraft server backups.
What does UnsupportedClassVersionError mean?
UnsupportedClassVersionError means the server or an add-on was built for a newer Java than the one the server is running on. The fix: switch to a newer Java version, or use a build of the mod or plugin made for your game version.
A typical console message looks like this:
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent
version of the Java Runtime (class file version 65.0), this version of the Java Runtime only
recognizes class file versions up to 61.0
The "class file version" numbers map to Java versions. The first is the Java the file needs, the second is the Java the server runs on:
| class file version | Java version |
|---|---|
| 52.0 | Java 8 |
| 55.0 | Java 11 |
| 60.0 | Java 16 |
| 61.0 | Java 17 |
| 65.0 | Java 21 |
| 69.0 | Java 25 |
In the example above, the file needs Java 21 (65.0) and the server runs Java 17 (61.0). What to do:
- If the error names a Minecraft or engine class (
net/minecraft/...,io/papermc/...,net/neoforged/...) – Java doesn't match the game version. Set "JAVA version" to "Auto" and restart the server. - If the error names a mod or plugin class – the add-on is for a newer game version or needs a newer Java. Ideally, download the build made for your Minecraft version. If the author clearly says it works on your game version but needs a newer Java, select that Java in "JAVA version".
On Spot.gg you don't have to dig through the logs yourself: the bug icon in the server bar turns red when the logs since the last start contain a problem, and the "Detected errors" window shows a "Java compatibility" entry. For reading logs and crash reports in general, see Minecraft Exit Code 1.
Other errors caused by the wrong Java version
Java that's too old gives UnsupportedClassVersionError; Java that's too new for old mods usually gives a ClassCastException or a crash right after start. The most common symptoms:
| Console symptom | Cause | Fix |
|---|---|---|
UnsupportedClassVersionError |
Java too old for the game or an add-on | Set "Auto" or a newer Java; check the add-on version |
ClassCastException ... cannot be cast to class java.net.URLClassLoader |
Old Forge (1.12.2 and older) on Java newer than 8 | Set Java 8 |
Server stops right after start, no Done ( line |
Often the wrong Java for a modded engine | Set "Auto" and compare with the modpack's requirements |
If a modded server still won't start after fixing Java, the culprit may be a specific mod rather than Java – see how to make a modded Minecraft server.
FAQ
What Java version for Minecraft 26.3?
Java 25. Since 26.1, Minecraft requires Java 25 or newer, for both the game and the server. On Spot.gg a 26.3 server set to "Auto" starts on Java 25.
What Java version for Minecraft 1.21 and 1.20.1?
Minecraft 1.21–1.21.11 (and 1.20.5–1.20.6) needs Java 21. Minecraft 1.20.1 runs on Java 17 – worth knowing, because many Forge modpacks are on that version.
Can I use a newer Java than Minecraft requires?
Usually yes for Vanilla and Paper, since Mojang lists a minimum. With older modded engines (especially Forge 1.16.5 and older) a newer Java often causes crashes, which is why "Auto" picks the version that matches the engine rather than simply the newest.
Do I need to install Java on a Spot.gg server?
No. Java 8, 11, 17, 21 and 25 are already on the server, and you pick one in "Configuration" → "Server" → "JAVA version". You can't upload your own Java install or change the launch parameters – the server starts with settings matched to the engine.
Do players need the same Java as the server?
No. Players need the same Minecraft version as the server, and the Minecraft launcher downloads the right Java by itself. The server's Java version doesn't affect who can connect.