To change the Java version of a Minecraft server, first check which Java your Minecraft version needs (Java 8 for 1.12–1.16.5, Java 17 for 1.18–1.20.4, Java 21 for 1.20.5–1.21.11, Java 25 for 26.1 and newer), then switch the Java runtime the server starts with. On a panel such as ours you do it in Startup → Docker Image; on your own PC you install that Java and point your start command to it. Restart and check the log.
The error that brings most people here looks like this: UnsupportedClassVersionError ... class file version 65.0, this version of the Java Runtime only recognizes class file versions up to 61.0. It means the server JAR was built for a newer Java than the one running it.
Which Java version each Minecraft version needs
The Minecraft Wiki lists the minimum Java version for each range of Java Edition releases:
| Minecraft Java Edition | Minimum Java |
|---|---|
| 1.12 to 1.16.5 | Java 8 |
| 1.17 to 1.17.1 | Java 16 |
| 1.18 to 1.20.4 | Java 17 |
| 1.20.5 to 1.21.11 | Java 21 |
| 26.1 and newer | Java 25 |
Paper, Purpur, Fabric, Forge and NeoForge follow the same table, because they run on the Minecraft version underneath. Plugins and mods can ask for more: if a plugin page says "Java 21 required", it does not matter that your Minecraft version accepts Java 17.
How to read the class version error
The numbers in the error are class file versions, not Java versions. Use this table to translate them:
| Class file version | Java version |
|---|---|
| 52 | Java 8 |
| 60 | Java 16 |
| 61 | Java 17 |
| 65 | Java 21 |
| 69 | Java 25 |
So "class file version 65.0 … up to 61.0" reads as: the server needs Java 21 and you are running Java 17. The same error in a plugin's stack trace means that plugin needs a newer Java than your server is using.
How to change Java version on a Minecraft server in the panel
- Go to Backups and create a backup. It takes a minute and protects you if you end up downgrading by mistake.
- Stop the server from the Console.
- Open Startup and find Docker Image.
- If your server offers several images, choose the one with the Java version from the table above, for example Java 21 for 1.21.1.
- Start the server and watch the Console. The first lines usually show the Java version that started, and the server should reach
Done. - If Docker Image shows only one option, or none matches what you need, open a ticket and ask support for the Java version you need.
If you are also switching the Minecraft version, do it first in Version, then match Java. Our guide on how to update a Minecraft server covers the order of steps and the backup.
How to change the Java version on your own PC
On a home server or a VPS you control Java yourself.
- Install the Java version you need (a build of OpenJDK such as Eclipse Temurin works well).
- Check what your system uses by default:
java -version
- If the default is wrong, call the right Java directly in your start script. On Linux, for example:
/usr/lib/jvm/java-21-openjdk/bin/java -Xmx4G -jar server.jar nogui
- On Windows, use the full path to
java.exeinside the Java install folder in yourstart.bat, and wrap it in quotes if the path has spaces. - Start the server and confirm the version in the first lines of the log.
Several Java versions can live on one PC. Calling the full path in the script avoids changing the default for everything else.
Common Java problems and fixes
- Server will not start after an update: the new Minecraft version needs a newer Java. Look up the table and switch.
- Old modpack crashes on start: 1.12.2 and 1.16.5 packs need Java 8. Do not run them on 17 or 21.
- A single plugin fails to enable: the plugin needs a newer Java than the server. Update Java (if the Minecraft version allows it) or use an older build of the plugin.
- The server runs but uses too little memory: that is a RAM setting, not Java. See Minecraft server not using allocated RAM.
- Still not starting: our Minecraft server not starting checklist covers EULA, port and corrupt-file errors.
Run every Minecraft version on TheGameHosting
Switching versions is normal on a busy server, and the panel is built for it. On TheGameHosting the Version Changer installs Paper, Purpur, Fabric, Forge, NeoForge, Vanilla and more, Startup holds the Java image, Backups saves a copy before every change and the Console shows you the result right away. Servers run 24/7 in Dallas or Amsterdam on AMD 9950X or 7950X3D CPUs with NVMe, with DDoS protection on every plan.
Plans start at $1.90 USD per month on Minecraft server hosting. Compare RAM sizes on the game server plans page and use FULL2026 for 15% off for life. Choose a plan on Pricing and your server is ready in about 60 seconds.
FAQ
What Java version do I need for a Minecraft server?
Java 21 for 1.20.5 to 1.21.11, Java 25 for 26.1 and newer, Java 17 for 1.18 to 1.20.4 and Java 8 for 1.12 to 1.16.5. Mods and plugins can ask for a newer one.
How do I change the Java version of my hosted Minecraft server?
Stop the server, open Startup and pick the matching Java in Docker Image, then start it again. If the option you need is missing, ask support.
What does "class file version 65.0" mean?
Class file version 65 is Java 21. The server or a plugin needs Java 21, and the Java running it is older.
Can I use Java 21 for a 1.16.5 server?
Vanilla 1.16.5 only needs Java 8 or newer, but modded 1.16.5 servers on Forge often crash on newer Java. Use Java 8 for those.
Hosting for this game
Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.
All posts
TheGameHosting Team
