Java Version Issues
This guide helps you fix Java version errors on Minecraft servers, including crashes caused by mismatched Java versions.
Which Java Version Do I Need?
Section titled “Which Java Version Do I Need?”| Minecraft Version | Required Java |
|---|---|
| 1.21.x | Java 21 |
| 1.20.x | Java 21 |
| 1.18.x - 1.19.x | Java 17 |
| 1.17.x | Java 16 or 17 |
| 1.12.x - 1.16.x | Java 8 |
| 1.7.x - 1.11.x | Java 8 |
How to Check Your Current Java Version
Section titled “How to Check Your Current Java Version”- Open your server in the control panel
- Go to the Console tab
- Look at the first few lines when the server starts
You’ll see something like:
Starting with Java 17...or
[Server] Java Version: 21.0.1How to Change Java Version
Section titled “How to Change Java Version”- Go to your server in the control panel
- Click Startup in the sidebar
- Find Java Version or Docker Image dropdown
- Select the correct Java version for your Minecraft version
- Click Save (if applicable)
- Restart your server
Common Java Errors
Section titled “Common Java Errors”| Error | Meaning | Fix |
|---|---|---|
UnsupportedClassVersionError | Java too old for the Minecraft version | Upgrade Java |
java.lang.UnsupportedClassVersionError: ... has been compiled by a more recent version | Same as above | Upgrade Java |
Error: A JNI error has occurred | Java version mismatch | Check and set correct Java |
Exception in thread "main" followed by class version numbers | Java incompatibility | Match Java to your MC version |
How to Read Class Version Numbers
Section titled “How to Read Class Version Numbers”If you see an error like:
class file has wrong version 65.0, should be 61.0The numbers map to Java versions:
- 52 = Java 8
- 61 = Java 17
- 65 = Java 21
This error means your code needs Java 21 (65) but you’re running Java 17 (61).
Forge-Specific Java Requirements
Section titled “Forge-Specific Java Requirements”Some Forge versions have specific requirements:
| Forge + MC Version | Java Requirement |
|---|---|
| Forge 1.20.4+ | Java 21 required |
| Forge 1.18 - 1.20.1 | Java 17 required |
| Forge 1.17.x | Java 16 or 17 |
| Forge 1.16.x and older | Java 8 required |
Fabric-Specific Notes
Section titled “Fabric-Specific Notes”Fabric is generally more flexible with Java versions, but:
- MC 1.20.5+ requires Java 21
- MC 1.18+ works best with Java 17 or 21
- Older versions work with Java 8
Check your Fabric loader’s requirements if you’re unsure.
Still Not Working?
Section titled “Still Not Working?”Before contacting support, gather these 3 things:
- Server ID — found in your panel URL or dashboard
- What you tried — list the steps you already attempted
- Error message or screenshot — exact text or image of what you see
Then contact us:
- Email: support@mambahost.com
- Discord: Open a ticket in our server