The version table
Use the newest Java your Minecraft version supports. These are the minimums:
- Minecraft 26.1 and newer: Java 25
- Minecraft 1.20.5 to 1.21.11: Java 21
- Minecraft 1.17 to 1.20.4: Java 17
- Minecraft 1.16.5: Java 16 (Java 17 works)
- Minecraft 1.12 to 1.16.4: Java 11; Minecraft 1.7.10 to 1.11: Java 8
Do not confuse the version numbers
Since 2026 Minecraft Java uses year-based version numbers such as 26.1. That number has nothing to do with the Java version. Minecraft 26.1 runs on Java 25, not on a "Java 26".
Very old Minecraft versions can break on very new Java releases, and some old modpacks only run on Java 8. For anything 1.16.5 or older, use what the modpack or server software recommends.
Recognising a Java version error
A server started on a Java that is too old usually stops immediately with an UnsupportedClassVersionError that mentions a class file version, such as "class file version 65.0". Paper also prints a clear message saying which Java it needs.
- Class file 69 is Java 25
- Class file 65 is Java 21
- Class file 61 is Java 17
- Class file 52 is Java 8
Changing Java on your server
At home, install the matching Java build, such as Eclipse Temurin, and either make it the default or point your start script at it with its full path. Run java -version to check what the system uses.
On a hosted server you normally pick the Java version from the startup or Docker image settings rather than installing it. On StormNodes this lives on the server's Startup page. Update Java before updating Minecraft, so the server can start on the new version straight away.