โ Which Java Version to Choose for Your Minecraft Server?
Last updated: March 2026
Is your Minecraft server crashing on startup? Getting an error like Unsupported class file major version or Java 17 is required? In 90% of cases, it's a Java version problem.
Minecraft is coded in Java, and each game version requires a specific Java version to run. Using the wrong version = guaranteed crash.
In this guide, we'll explain exactly which Java version to use for your server.
๐ Java / Minecraft Compatibility Tableโ
| Minecraft Version | Minimum Java | Recommended Java | Notes |
|---|---|---|---|
| 1.0 โ 1.11 | Java 8 | Java 8 | Legacy versions, do not use Java 17+ |
| 1.12 โ 1.16.4 | Java 8 | Java 8 or 11 | Most Forge 1.12 mods require Java 8 |
| 1.16.5 | Java 8 | Java 11 or 16 | Transition โ Java 8 works but 11+ recommended |
| 1.17 โ 1.17.1 | Java 16 | Java 16 or 17 | First major change โ Java 8 no longer works |
| 1.18 โ 1.20.4 | Java 17 | Java 17 | Mojang requires Java 17 minimum |
| 1.20.5 โ 1.21+ | Java 21 | Java 21 | Since 1.20.5, Java 21 is mandatory |
- Minecraft 1.16 and before โ Java 8
- Minecraft 1.17 โ Java 16 or 17
- Minecraft 1.18 to 1.20.4 โ Java 17
- Minecraft 1.20.5+ โ Java 21
๐ง What About Frameworks?โ
Your framework (Paper, Forge, Fabric...) may also require its own Java version, sometimes newer than the Minecraft minimum.
| Framework | Minecraft Version | Recommended Java |
|---|---|---|
| Paper / Purpur | 1.18+ | Java 21 (recommended by Paper since 2024) |
| Paper / Purpur | 1.17 | Java 17 |
| Spigot | 1.18+ | Java 17 minimum |
| Forge | 1.12.2 | Java 8 only |
| Forge | 1.16.5 | Java 8 |
| Forge | 1.18 โ 1.20.4 | Java 17 |
| Forge / NeoForge | 1.20.5+ | Java 21 |
| Fabric | 1.18 โ 1.20.4 | Java 17 |
| Fabric | 1.20.5+ | Java 21 |
Some older modpacks (RLCraft, Pixelmon 1.12) require Java 8 even if newer Java versions exist. Always check the modpack requirements.
โ Common Java Errorsโ
Unsupported class file major version 65โ
โ You're using a jar compiled for Java 21 but your server is running Java 17 or lower. Solution: Switch to Java 21.
java.lang.UnsupportedClassVersionErrorโ
โ Same issue โ the jar needs a newer Java version. Solution: Check the table above and adjust your Java version.
Error: A JNI error has occurredโ
โ Java version conflict. Often caused by Java 8 on a 1.17+ server. Solution: Update Java.
Server starts but crashes immediatelyโ
โ If you see Java 17 is required to run this version or similar in the logs, the message is clear: wrong Java version.
Solution: Change the version in your panel settings.
๐ ๏ธ How to Change Java Version on Lordhosting?โ
In short: go to Startup โ change the Docker Image โ restart. Done in 30 seconds.
๐ค Java 17 or Java 21? Which One to Choose in 2026?โ
If your server supports Java 21, choose Java 21. Here's why:
| Java 17 | Java 21 | |
|---|---|---|
| Support | LTS, end of support 2029 | LTS, end of support 2031 |
| Performance | Good | Better (~5-15% faster) |
| Garbage Collector | G1GC / ZGC | Improved ZGC (fewer lag spikes) |
| 1.20.5+ compatibility | โ No | โ Yes |
Java 21 brings notable performance improvements for Minecraft servers, including a more efficient garbage collector that reduces micro-freezes (lag spikes).
If you're on 1.18 โ 1.20.4, Java 21 also works and offers better performance than Java 17. Paper officially recommends it.
๐ Quick Summaryโ
| Your situation | Java Version |
|---|---|
| Modpack 1.12.2 (RLCraft, Pixelmon...) | Java 8 |
| Server 1.16.5 Forge | Java 8 |
| Server 1.16.5 Paper/Spigot | Java 11 or 16 |
| Server 1.17 | Java 17 |
| Server 1.18 โ 1.20.4 | Java 17 (or 21 for better performance) |
| Server 1.20.5+ / 1.21+ | Java 21 |
Need help configuring Java on your server? Our support team is available Monday to Saturday from 10am to 11pm to help you! ๐ฎ