Which Java Version to Choose for Your Minecraft Server?
Complete guide to choosing the right Java version for your Minecraft server. Java 8, 17, 21? Find the right version based on your jar and mods.
Try this guide on a real Minecraft server, free for 12 hours
A Minecraft server ready in minutes to put this tutorial into practice, then you decide.
- No credit card
- 12 hours from first launch
- One trial per person
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.
Want to put this guide into practice on your own server? Minecraft server hosting from €3.99/month at LordHosting, online in a few minutes.
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 9am to 9pm to help you! 🎮
Looking for Minecraft server hosting with Java preconfigured? Plans start at €3.99/month.
Put this guide into practice on your own server
From €3.99/month. Online in a few minutes, anti-DDoS protection, 7/7 support, no commitment.
Related guides
WorldEdit on Minecraft: install the plugin and import a schematic
WorldEdit guide for a Minecraft server: install the plugin on Paper or Spigot, import a .schem schematic and paste a build from your panel.
How to allow cracked versions on a Minecraft server
Configure your Minecraft server to accept cracked versions (online-mode false): steps, risks, security and alternatives for admins.
How to Install an Arcadia Echoes of Power Minecraft Server
Learn how to install the Arcadia Echoes of Power modpack on your Minecraft server with LordHosting, the exclusive hosting provider for multiplayer.
The Best Minecraft Mods (and How to Install Them)
The best Minecraft mods and modpacks, and how to install them step by step in singleplayer and on your Minecraft server (Forge, Fabric, NeoForge).

