← All guides
FreaksMC Guides

Which Java Version Does Your Minecraft Server Need? (Java 8, 17, 21)

Updated September 1, 2026 · 3 min read

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.

Short answer
Match Java to your Minecraft version: 1.16.5 and older Java 8, 1.17 Java 16/17, 1.18-1.20.4 Java 17, and 1.20.5, 1.21 and newer Java 21. Old Forge packs (1.7-1.12) specifically need Java 8. If your host picks Java automatically (FreaksMC does), you never have to worry about this.

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:

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

We use cookies for analytics & ads to measure how our site performs. Essential cookies always run. See our Privacy Policy.