Minecraft server Java version for every Minecraft version
The Minecraft server Java version follows the game version: Java 25 for 26.1 and newer, Java 21 for 1.20.5 to 1.21.11, Java 17 for 1.18 to 1.20.4, Java 16 for 1.17 and Java 8 for 1.12 to 1.16.5. Paper recommends a newer Java than that minimum on some older versions:
| Minecraft version | Java it needs at least | Java Paper recommends |
|---|---|---|
| 26.1 to 26.3 | Java 25 | Java 25 |
| 1.20.5 to 1.21.11 | Java 21 | Java 21 |
| 1.20 to 1.20.4 | Java 17 | Java 21 |
| 1.18 to 1.19.4 | Java 17 | Java 17 |
| 1.17 and 1.17.1 | Java 16 | Java 17 |
| 1.16.5 | Java 8 | Java 16 |
| 1.12 to 1.16.4 | Java 8 | Java 11 |
Fabric, Forge and NeoForge run inside the same Java as the game, so a modded server needs at least the Java of its Minecraft version: a Forge modpack on 1.20.1 needs Java 17, and a NeoForge pack on 1.21.1 needs Java 21.
Java version for Minecraft 26.1, 26.2 and 26.3
Minecraft 26.1, 26.2 and 26.3 need Java 25. Version 26.1, released on 24 March 2026, was the first to require it, and the game itself now ships with the Microsoft build of OpenJDK 25. It was also the first release with the new year.drop.hotfix numbers, which is why there is no Minecraft 1.22: the version after 1.21.11 is 26.1.
So moving a server from 1.21.11 to 26.1 or newer always means a Java upgrade from 21 to 25 as well. Paper's own getting started page says the same: current Paper needs at least Java 25.
How to fix class file version 69.0 and 65.0 errors
To fix a class file version 69.0 error, run the server on Java 25, and for class file version 65.0, Java 21 is enough: the error means that the server jar or a plugin was built for a newer Java than the one that starts it. The full message looks 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 first number is the Java the file needs, the second the Java you have. In this example a 26.x server, or a plugin built for it, meets Java 21. These are the numbers you will see:
- 69.0 is Java 25, needed for Minecraft 26.1 and newer.
- 65.0 is Java 21, needed for 1.20.5 to 1.21.11.
- 61.0 is Java 17, needed for 1.18 to 1.20.4.
- 60.0 is Java 16, and 52.0 is Java 8.
If the message names a plugin or mod instead of the server jar, the server runs on the right Java for its version, but that plugin was built for a newer one. Download the build of the plugin that matches your Minecraft version.
How to check the Java version of a Minecraft server
To check the Java version of a Minecraft server at home, type java -version in a terminal or command prompt: the first line shows the version, for example 25 or 21. On a computer with more than one Java installed, the start script may use a different one than that command, so check the path to java in the script as well. On a hosted server, the panel shows or sets the Java version.
How to change the Java version for a Minecraft server
To change the Java version for a Minecraft server at home, install the Java your Minecraft version needs and start the server with it, in 3 steps:
- Install the right Java. Paper's guide to installing Java uses Amazon Corretto: the installer on Windows,
brew install openjdk@25on a Mac, and Amazon's package repository on Ubuntu and Debian. - Point the start script at it. Replace
javain the start command with the full path to the new Java's java file if an older Java is still installed. - Start the server and check the console: the class file version error is gone once the versions match.
On a hosted server, the Java version is a setting in the panel. On panels based on Pterodactyl, it is the Docker Image list on the Startup tab, according to Paper's Java guide. At Astroworld Hosting there is nothing to pick: the panel chooses the Java runtime from the Minecraft version you set on the Settings tab, and runs 1.20.5 and newer on Java 25.
Can an older Minecraft server run on Java 25?
An older Minecraft server from 1.20.5 up runs on Java 25: Astroworld Hosting runs those versions on Java 25 for every customer and calls a newer runtime almost never a problem, while an older one always is. For versions before 1.20.5, follow the Java that Paper recommends in the table, and for a modpack, use the Java its own page asks for.
Best Java version for a Minecraft server
The best Java version for a Minecraft server is the one in the table for your Minecraft version, as a 64-bit OpenJDK build: the Microsoft build of OpenJDK that Minecraft itself ships, or Amazon Corretto, which Paper's docs use. Both are free. You do not need an Oracle license to run a Minecraft server, and a JDK works as well as a JRE for running one.
Java arguments for a Minecraft server
The Java arguments most Minecraft servers start with are Aikar's flags, which Paper's docs recommend: the same value for -Xms and -Xmx, for example 6500M on a machine with 8 GB, plus a set of settings for the G1 garbage collector. The start of the command looks like this:
java -Xms6500M -Xmx6500M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 ... -jar server.jar --noguiLeave 1 to 1.5 GB of the machine's memory outside -Xmx, because Java and the system need room on top of it. Paper's page on Aikar's flags has the full line and a start script generator. On a hosted server the panel sets the memory from your plan, so you rarely need to touch these.

