Java 17, 21 or 25 for a Minecraft Server? Version Table 2026

Published on | Updated

Minecraft 1.20.1 requires Java 17, 1.20.5 to 1.21.11 Java 21 and 26.x Java 25. A version table from Mojang's files, when Java 21 helps and how to switch.

Rows of glowing server racks in a Minecraft-style data center

Your 1.20.1 modpack stops with "Minecraft 1.20.1 requires Java 17", or you are about to update a server and wonder whether Java 17, 21 or 25 belongs on it. Mojang settles most of this: every Minecraft version has a version file that names its Java. This guide puts those files in one table, explains the 1.20.1 message, shows the one range where you really choose between Java 17 and Java 21, and covers what a newer Java changes once your server runs on it.

Quick answer: The Minecraft version decides. Minecraft 1.18 to 1.20.4 need Java 17 or newer, so Minecraft 1.20.1 requires Java 17. Minecraft 1.20.5 to 1.21.11 require Java 21, and 26.1 to 26.3 require Java 25. The real choice comes on 1.18 to 1.20.4: Java 21 runs those versions too, and PaperMC recommends it for Paper 1.20 to 1.20.4. Modpacks such as All the Mods 9 name Java 17, so a modded 1.20.1 server stays on Java 17. No source gives a fixed speed gain for a newer Java, so measure your own server before and after you switch.

Which Java Each Minecraft Version Needs

Every release has a version file on Mojang's servers with a javaVersion field, and the launcher installs the Java it names. We read the file of every release in Mojang's version list on 31 October 2026. The right column is PaperMC's own recommendation for Paper servers.

Minecraft versionJava in Mojang's version filePaperMC recommends
26.1 to 26.3Java 25Java 25
1.20.5 to 1.21.11Java 21Java 21
1.20 to 1.20.4, including 1.20.1Java 17Java 21
1.18 to 1.19.4Java 17Java 17
1.17 and 1.17.1Java 16Java 17
1.16.5 and olderJava 8Java 16 (1.16.5), Java 11 (1.12 to 1.16.4), Java 8 (older)

From 1.18 on, the middle column is a hard minimum. Mojang moved to Java 17 in 1.18 Pre-release 2 (16 November 2021), to Java 21 in snapshot 24w14a (3 April 2024) and to Java 25 in 26.1 Snapshot 1 (16 December 2025). The server jars match: their main class is class file version 61, the Java 17 format, in the 1.18, 1.20.1 and 1.20.4 jars, 65 (Java 21) in 1.20.5 and 1.21.11, and 69 (Java 25) in 26.1 and 26.3. A Java runtime loads class files up to its own version and refuses newer ones, so as far as the class files go, a newer Java can run an older server but never the other way round.

For install commands and the error messages per version, see our Minecraft Java version requirements guide. This page is about choosing between Java 17, 21 and 25.

Minecraft 1.20.1 Requires Java 17

Mojang's 1.20.1 version file names Java 17 ("majorVersion": 17), and the launcher gives players a Java 17 runtime (17.0.15 in Mojang's runtime list) without asking. A server gets no such help: it runs on whatever Java the machine or container has. The 1.20.1 server jar is built as class file version 61, so Java 8, 11 and 16 cannot load it. On Java 8 the server stops before Minecraft prints a line:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

The last number is the newest class file your Java reads: 52 is Java 8, 55 is Java 11 and 60 is Java 16.

The exact sentence "Minecraft 1.20.1 requires Java 17" is printed by modpack start scripts, such as the ones in the All the Mods 9 server files. Both startserver.sh and startserver.bat check Java before they start the server and stop with one of these lines:

Minecraft 1.20.1 requires Java 17 - Java not found
Minecraft 1.20.1 requires Java 17 - found Java 1

found Java 1 means Java 8. The script keeps the number before the first dot of the Java version, and Java 8 reports itself as 1.8.0. The check passes on Java 17 or anything newer.

Install Java 17 and either make it the default java or point the script at it. ATM9's scripts read an ATM9_JAVA variable with the full path of the Java to use. On Ubuntu 22.04 or 24.04, run this in the server folder:

sudo apt install openjdk-17-jdk
ATM9_JAVA=/usr/lib/jvm/java-17-openjdk-amd64/bin/java sh startserver.sh

That path belongs to Ubuntu's package on a 64-bit Intel or AMD machine; ls /usr/lib/jvm shows the folders on yours. On Windows, set ATM9_JAVA to the full path of java.exe, as the comment at the top of startserver.bat says. Our ATM9 server page lists the same Forge 47.4.0 and Java 17 for pack 1.1.1.

Java 17 or Java 21 for a 1.20.1 Server?

From 1.18 to 1.20.4 you can pick, because Java 21 reads every class file version up to 65, including the 61 these jars use. The server software decides:

  • Paper: PaperMC's getting started page recommends Java 21 for Paper 1.20 to 1.21.11, while its download API lists Java 17 as the minimum for 1.20.1. On a Paper 1.20.1 server, Java 21 is the recommended choice.
  • Vanilla: Mojang names Java 17 and ships it to players. Java 21 loads the jar as well, which is handy when one machine runs a 1.20.1 and a 1.21 server side by side.
  • Forge modpacks: follow the pack. The All The Mods Java guide lists Java 17 for 1.18 and newer and Java 21 from 1.21. Forge itself keeps up with newer Java: its 1.20.1 changelog lists "Bump ASM to 9.8 for Java 25 runtime support" in build 47.4.9 and an ASM update "for Java 26 support" in 47.4.17. ATM9 1.1.1 ships Forge 47.4.0, older than both, so keep that pack on the Java 17 it names. A loader that copes with a newer Java says nothing about each of the hundreds of mods in a pack, so test a copy before you move a modded world. ATM10 is a 1.21.1 pack and needs Java 21; our ATM10 Java guide covers it.

What Java 21 Changes Compared to Java 17

Java 17 came out on 14 September 2021 and Java 21 on 19 September 2023. Both are long-term support (LTS) releases. Three differences matter on a game server.

Garbage collection. Java 21 added Generational ZGC (JEP 439), a mode of the low-pause ZGC collector that collects young objects more often. It is opt-in: -XX:+UseZGC -XX:+ZGenerational. G1, the collector Aikar's flags tune, works on both versions, and PaperMC's download API recommends the same 18 JVM flags, built around G1, for 1.20.1, 1.21.11 and 26.3. Your Aikar's flags carry over unchanged, and when ZGC is worth a test is in our ZGC vs G1GC guide.

Text encoding. From Java 18 on, Java reads and writes text as UTF-8 unless a program asks for something else (JEP 400). Up to Java 17, Windows used a code page such as windows-1252. A Windows server whose plugins read config files without naming a charset can show accented letters differently after the move; start Java with -Dfile.encoding=COMPAT to get the old behavior back. Many Linux distributions already defaulted to UTF-8, so nothing changes there.

Updates. Eclipse Adoptium lists Temurin updates for Java 17 until at least October 2027, for Java 21 until at least December 2029 and for Java 25 until at least September 2031. A 1.20.1 server on Java 17 still gets security fixes, and Java 21 gives you about two more years of them.

Is Java 21 Faster Than Java 17?

We have not benchmarked Java 21 against Java 17, and the Mojang and PaperMC pages in our sources give no figure either. So measure it on your own server. With the spark plugin or mod installed, run /spark tps and /spark gc at a busy hour on Java 17, switch, and run them again at a similar hour. /spark tps shows the TPS rate and CPU usage, /spark gc the garbage collection history. If the numbers do not improve, going back is one path in the start script.

Java 25: Only for Minecraft 26.1 and Newer

Java 25 came out on 16 September 2025 and is the LTS release after Java 21. Minecraft needs it from 26.1 on: the 26.1 Snapshot 1 changelog says "The game now requires Java 25", and the version files of 26.1, 26.1.1, 26.1.2, 26.2 and 26.3 all name it. PaperMC still recommends Java 21 for 1.20.5 to 1.21.11, so switch to Java 25 together with your move to 26.x, not before. Our 26.3 server update guide covers the rest of that move.

Once you run Java 25:

  • ZGC flags get shorter. -XX:+UseZGC alone runs generational ZGC, and -XX:+ZGenerational from a Java 21 line only prints an obsolete-option warning (JEP 490). Java 26 and newer refuse to start with it (JDK-8369983), so delete it.
  • Compact object headers become an option. -XX:+UseCompactObjectHeaders is a regular product option since Java 25 (JEP 519). It shrinks object headers to 64 bits (JEP 450), is off by default and is not in Paper's flag set, so try it on a copy first.
  • Old modpacks may not start. Forge added Java 25 runtime support to 1.20.1 in build 47.4.9, so a 1.20.1 pack on an older Forge belongs on Java 17.

Java 26 and 27 exist as well, but they are short-term releases: Adoptium's support table ends Java 26 updates in September 2026. Stay on the LTS release Mojang names.

How to Switch Without Breaking the Server

  1. Back up the world and the server folder.
  2. Install the new Java next to the old one. On Ubuntu 22.04 or 24.04, sudo apt install openjdk-21-jdk puts Java 21 beside Java 17. For Java 25 and other systems, follow the requirements guide.
  3. Call it by its full path in the start script, so other servers on the machine keep their own Java.
  4. Start a copy first, log in, visit busy farms and chunks, then switch the live server in a quiet hour.

For step 3 on Ubuntu, with Java 21:

/usr/lib/jvm/java-21-openjdk-amd64/bin/java -version
/usr/lib/jvm/java-21-openjdk-amd64/bin/java -Xms4G -Xmx4G -jar server.jar nogui

The first command should report version 21 and, on its last line, a 64-Bit Server VM.

On a hosting panel you don't install Java yourself. In Pterodactyl, the Java version is the Docker image you pick in the server's Startup tab, as PaperMC's Java guide shows. On a Space-Node Minecraft server you set the Java version and your JVM flags there yourself, no ticket needed.

FAQ

Does Minecraft 1.20.1 require Java 17? Yes. Mojang's 1.20.1 version file names Java 17, the server jar is built for Java 17, and Java 8, 11 or 16 stop it with an UnsupportedClassVersionError. Java 17 is the minimum; Java 21 runs it too.

Can I run a Minecraft 1.20.1 server on Java 21? Yes for vanilla and Paper: Java 21 loads Java 17 class files, and PaperMC recommends Java 21 for Paper 1.20 to 1.21.11. For Forge modpacks such as ATM9, use the Java 17 the pack names, and test a copy before you try Java 21.

Does Minecraft 1.20.5 require Java 21? Yes. Mojang's 1.20.5 changelog says "The game now requires Java 21", a change that started with snapshot 24w14a, and every release up to 1.21.11 names Java 21. Java 17 cannot start these servers. The Java version requirements guide has the error messages and install steps.

Is Java 21 faster than Java 17 for a Minecraft server? There is no fixed figure to quote. Java 21 adds Generational ZGC as an option, and your G1 flags stay the same. Compare /spark tps and /spark gc before and after the switch at similar hours.

Do I need Java 25 for my Minecraft server? Only for 26.1 and newer: 26.1, 26.1.1, 26.1.2, 26.2 and 26.3 all name Java 25. Keep 1.20.5 to 1.21.11 on Java 21 and 1.18 to 1.20.4 on Java 17 or 21. A Forge 1.20.1 build older than 47.4.9 lacks Forge's Java 25 runtime support.

Why does my start script say "found Java 1"? Your server runs Java 8. Start scripts like ATM9's read the number before the first dot of the Java version, and Java 8 reports itself as 1.8.0. Install Java 17 and point the script at it with ATM9_JAVA.

Sources

All opened on 31 October 2026:


Legal Notice

Legal Notice & Disclaimer: This article constitutes an independent, factual comparative review and critical analysis for educational purposes only. Space-Node is not affiliated with, endorsed by, or sponsored by any hosting provider mentioned herein. All brand names, logos, and trademarks referenced are the registered intellectual property of their respective owners and are used solely for identification and factual reference.

Fair Use & Review Rights: This review is protected commentary, comparison, and criticism. It is based on publicly available information, official pages where available, published documentation, and general hosting engineering analysis. Where hands-on testing is not explicitly stated in the article, no private benchmark or internal infrastructure access is implied. This constitutes lawful comparative review and criticism protected under fair use doctrine.

Factual Accuracy: Specific plan claims are based on public information available at the time of writing. Specifications, pricing, and service features can change, so readers should verify current details on the provider's official website before purchasing. We make no false or defamatory statements; criticism is limited to documented facts, clearly labeled opinion, or general hosting guidance.

No Consumer Confusion: This article makes clear that Space-Node offers distinct, independently-developed hosting infrastructure. We explicitly differentiate our services, pricing, and technical specifications. No reader could reasonably be confused about service provider identity.

Right to Comparative Advertising: Space-Node reserves the right to publish factual comparative information about competing services. This is a recognized right in consumer protection law and advertising standards. Accurate comparative reviews cannot constitute trademark violation, defamation, or unfair competition.

Limitation of Liability: Space-Node makes no warranty regarding third-party services reviewed. Readers are responsible for verifying information independently before purchasing. Space-Node disclaims liability for third-party service changes, outages, or policy modifications.

Space-Node Services: For Space-Node's own managed hosting solutions, visit Minecraft hosting or VPS hosting.