Guides / Startup flags
Which Java version does a Minecraft server need?
The Java version needed for each Minecraft server version, from 1.12 to the newest releases.
Updated
Each Minecraft version needs a minimum Java version. Using an older Java stops the server starting, usually with an UnsupportedClassVersionError.
Java by Minecraft version
- 1.12 – 1.16.5: Java 8 (1.16.5 also runs on Java 11)
- 1.17.x: Java 16 or newer
- 1.18 – 1.20.4: Java 17
- 1.20.5 – 1.21.x: Java 21
- Newest releases: a newer Java again. Check the release notes for the version you're installing.
The startup flags generator shows the right Java for each version.
Newer Java usually works
A newer Java can run older Minecraft versions in most cases, especially Java 17 and 21. The exceptions are very old versions (1.16 and earlier) and old mods that break on newer Java. For modded servers, use the version the modpack lists.
Check which Java you have
java -version
If several versions are installed, start the server with the full path to the one you want, for example /usr/lib/jvm/java-21-openjdk/bin/java.
Which build to install
Any OpenJDK build works. Eclipse Temurin (Adoptium) and Amazon Corretto are popular free choices for servers. Use a JDK or JRE for your operating system and processor (x64 or ARM).
On a panel
In Pterodactyl or Pelican, change the Docker image in the server's startup settings to the matching Java version.