Which Java Version Does Your Minecraft Server Need? (Java 8, 17, 21)
If your Minecraft server won't start, crashes instantly, or throws an "unsupported class version" error, there is a very good chance you are running the wrong version of Java. Minecraft is built on Java, and each Minecraft version expects a specific Java version - get it wrong and the server simply refuses to run. Here is the simple chart so you always match them up.
The version chart
| Minecraft version | Java version you need |
|---|---|
| 1.8 - 1.16.5 | Java 8 |
| 1.17.x | Java 16 or 17 |
| 1.18 - 1.20.4 | Java 17 |
| 1.20.5 - 1.21+ | Java 21 |
Newer is not always better here. A brand-new Java version will often fail to run an older Minecraft version or older Forge, which surprises people who assume the latest Java is safest. The rule is to match, not to max out.
Why it matters so much for modded servers
Vanilla Paper/Spigot servers are fairly forgiving, but Forge and NeoForge are strict. Old modpacks especially are a common trap:
- Forge 1.7 - 1.12 packs need Java 8, full stop. Running them on Java 17 or 21 will crash them on startup. That is why 1.12.2 classics like RLCraft and SkyFactory 4 still need Java 8.
- NeoForge and modern Forge (1.20.5+ / 1.21) need Java 21.
- A Java mismatch usually shows up as an instant crash, an "unsupported class version" error, or the server dying before it finishes loading. If that sounds like your problem, see Forge server won't start.
How to check and change your Java version
On a host, the Java version is usually set in the Startup settings of your control panel (sometimes labeled as the "version" or image your server runs on). Pick the one that matches your Minecraft version from the chart above, then restart.
If you run the server yourself, you would install the matching JDK and point your start script at it - but this is exactly the kind of fiddly setup a good host removes for you.
The easy way: let the host handle it
Juggling Java versions is one of the most annoying parts of running a server yourself, and one wrong pick is a startup crash. On FreaksMC, the right Java version is selected automatically for whatever Minecraft version you run - vanilla, Paper, Forge, NeoForge, old or new. You do not touch a Java setting; your server just boots on the correct one the first time. It is the kind of thing you should not have to think about, so we made it so you do not.
If you are setting up modded, our guides on Forge vs NeoForge vs Fabric and how much RAM you need pair well with getting Java right.
Common questions
What Java version does Minecraft 1.20 need? 1.20 through 1.20.4 need Java 17; 1.20.5 needs Java 21.
What Java version does 1.21 need? Java 21.
Do old Forge packs really need Java 8? Yes - Forge for 1.7 through 1.12 must run on Java 8. Newer Java will crash them.
Can I just install the newest Java for everything? No. Newer Java often will not run older Minecraft or older Forge. Match the version to the chart instead of installing the latest.
How do I avoid dealing with this at all? Use a host that auto-selects Java for your Minecraft version, so your server always boots on the correct one without you setting anything.
Want a server that just runs fast?
FreaksMC runs on NVMe hardware with performance-tuned defaults baked in - pre-optimized Paper, sane view distances, and one-click world pre-generation. Set up in 60 seconds.
See plans from $3/mo