Which Java version does your Minecraft server need?
Minecraft Java Edition runs on Java, and each Minecraft version is built for a certain Java version. Too old and the server refuses to start. Too new and older versions, especially old modpacks, can break in strange ways.
On our servers you rarely have to think about it: changing the Minecraft version in Settings sets the matching Java by itself. This page is for when you run something unusual, or when the console shows a Java error.
The table
| Minecraft version | Java version |
|---|---|
| 26.1 and newer | Java 25 |
| 1.20.5 to 1.21.11 | Java 21 |
| 1.18 to 1.20.4 | Java 17 |
| 1.17 and 1.17.1 | Java 16 |
| 1.16.5 and older, such as 1.12.2 and 1.8.9 | Java 8 |
Newer Java versions can often run a slightly older Minecraft, but the other way round never works. Old modded versions are the exception: Forge on 1.12.2 and 1.7.10 wants exactly Java 8.
How to set it
- Open Settings.
- Change the Minecraft version. The Java version follows automatically.
- Only if you need something else, pick a Java version by hand below it, for example Java 8 for an old modpack.
- Restart the server.
If you picked a Java version by hand and later change the Minecraft version, check the Java setting again. The automatic choice is almost always right.
Reading the error
When Java is too old, the console shows an error like this:
java.lang.UnsupportedClassVersionError: ... has been compiled by a more recent version of the Java Runtime (class file version 69.0), this version of the Java Runtime only recognizes class file versions up to 65.0The two numbers tell you what was needed and what is installed. Translate them with this table:
| Class file version | Java |
|---|---|
| 69 | 25 |
| 65 | 21 |
| 61 | 17 |
| 60 | 16 |
| 52 | 8 |
So the example needs Java 25 and found Java 21. Raise the Java version in Settings, or check that the Minecraft version there matches the server files.
Plugins and mods with their own needs
A plugin or mod built for a newer Java than your server runs gives the same class version error, but names that plugin. Either update Java together with Minecraft, or use an older build of that plugin that fits your version.
Old modpacks on Java 8 sometimes need extra startup flags that newer Java versions do not understand. If a pack's server files include their own start settings, use the Java version the pack's makers recommend.
Players need the right Java too
For the normal game, the Minecraft Launcher brings its own Java, so players do nothing. Third party launchers such as Prism Launcher can download the right Java per profile; when a modpack crashes at launch on a player's computer, a wrong Java in that launcher profile is a common cause.
Questions
Can I run Minecraft 1.8.9 on Java 21?
Sometimes the plain game starts, but plugins and mods from that era expect Java 8 and break in odd ways. Use Java 8 for 1.8.9.
Does a newer Java make the server faster?
A little, for versions that support it. The jump from Java 8 to 17 brought real gains. But never go above what the version or its mods support just for speed.
Where do I see which Java the server uses?
In Settings, under the Minecraft version. Paper and Purpur also print it in the first lines of the console at startup.
Checked against Minecraft Java 1.8.9 to 26.2, September 2026. Written by the Cheapest Minecraft Hosting team, updated .