NapNodes

← Minecraft guides

Minecraft · updated 24 October 2026

What Java Version Does Your Minecraft Server Need? From 1.8 to 26.x

Each Minecraft version needs a minimum Java version, and if the server starts with a different one, it shuts down with an error that makes no sense. The short rule: Java 25 for Minecraft 26.1 or later, Java 21 from 1.20.5 to 1.21.11, Java 17 from 1.18 to 1.20.4 and Java 8 for 1.16.5 and earlier.

Which Java each Minecraft version needs

Minecraft 26.1 and later (26.1.x, 26.2, 26.3): Java 25.

Minecraft 1.20.5 to 1.21.11: Java 21.

Minecraft 1.18 to 1.20.4: Java 17.

Minecraft 1.17 and 1.17.1: Java 16 (Java 17 also works).

Minecraft 1.16.5 and earlier (1.8, 1.12.2…): Java 8.

These are the minimums Mojang sets for each version in its launcher data, and Paper requires the same ones. Note the jump within 1.20: 1.20.4 runs on Java 17, but 1.20.5 already needs 21.

Rather not set it up yourself? Minecraft servers from €6 a month, no contract and a full refund within 72 hours. Or create a free Minecraft server, no card needed.

“class file version 65.0”: which Java you're missing

If the server shuts down with something like “UnsupportedClassVersionError: … 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”, your Java is older than it needs to be.

The maths: subtract 44. 52 is Java 8, 61 is Java 17, 65 is Java 21 and 69 is Java 25. In the example, the server needs Java 21 (65) and you have Java 17 (61).

It happens the other way round too. With old Forge versions and a Java that's too new you get “Unsupported class file major version 65” (or whatever the number is): there, your Java is too new. Use Java 8.

If you don't want to do the maths, paste the error into our Java tool for Minecraft and it tells you which Java to install. If the error is a different one, see why a server won't start.

How to install the right Java on your PC

  1. Download it

    Temurin (adoptium.net) has all the ones Minecraft needs: 8, 17, 21 and 25. Pick the one from the table, for your system and 64-bit. Microsoft's (Microsoft Build of OpenJDK) also works, but it doesn't have Java 8.

  2. Check which one you're using

    Open a terminal and type java -version. The first line says the version that runs when you type “java”.

  3. If you have several, choose in the script

    The server uses the first one it finds. To pick another, put the full path to its java in your start.bat or start.sh (on Windows it's usually in C:\Program Files\Eclipse Adoptium\…\bin\java.exe) instead of just “java”. The start script generator gives you the script ready-made.

  4. Don't use the launcher's

    The Minecraft launcher comes with its own Java, but it's for the game: it isn't readily available for starting a server.

Does a newer Java than required work?

Since 1.17, usually yes. If something fails on startup, go back to the one in the table.

On old versions, it's better to use exactly the right one. Forge from 1.16.5 downwards and its mods fail with newer Javas. Some old Paper versions refuse to start with a Java they don't recognise; with the -DPaper.IgnoreJavaVersion=true option it starts anyway, but that's at your own risk.

Plugins and mods have their own Java requirements too. ViaVersion needs Java 17 since its version 5 (June 2024) and Geyser, Java 21. On a 1.12.2 server with Java 8, the current versions of those plugins won't load (what you lose on an old version).

On NapNodes you don't have to install anything

The panel sets the right Java when the server is created and every time you change version in “Mods & plugins” → “Server type” or install a modpack: Java 25 for 26.x, Java 21 from 1.20.5 to 1.21.11, Java 17 from 1.17 to 1.20.4 and Java 8 for earlier ones.

When you switch to a version with Java 8, the panel turns off the terrain pregenerator (Chunky), which doesn't work on that Java: the world generates as you explore.

If a plugin doesn't load and you see “class file version” in the “Console”, that plugin needs a newer Java than your Minecraft version's. Look for an older version of the plugin or upgrade the server.

Frequently asked questions

What Java does Minecraft 1.21 need?

Java 21, like every version from 1.20.5 up to 1.21.11.

What Java does Minecraft 26.1 need?

Java 25. It also works for 26.2, 26.3 and the following ones in that numbering.

What Java does a Minecraft 1.12.2 Forge server need?

Java 8. With Java 17 or 21, Forge from that era fails on startup.

What does “class file version 69.0” mean?

That what you're trying to run is built for Java 25 and your Java is older. Subtract 44 from the number: 69 − 44 = 25.

Can I have several Java versions installed?

Yes. To pick one, put the full path to its java in the start script instead of just “java”.

Shall we set it up for you?

Minecraft servers from €6 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Minecraft server, no card needed.

Your server doesn't show up in the game? Check it in a second with “Is my Minecraft server online?”: players, version and MOTD, free. Need a player's UUID for the whitelist or permissions? Look it up here. Handing out enchanted items? Build the command with the /give generator.

Free tool: Which Java do I need?. Type your Minecraft version or paste the Java error and we'll tell you which Java your server or your game needs.

Free tool: start.bat generator. The start.bat or start.sh for your Minecraft server with the RAM set right and Aikar's flags, ready to download.

Keep reading

All Minecraft guides, sorted →