FreeMCHost logoFreeMCHost
All articles
Troubleshooting

Which Java Version for Your Minecraft Server?

The Java version each Minecraft release needs, and how to fix UnsupportedClassVersionError.

December 5, 20263 min read

The table

Minecraft versionJava
1.16.5 and olderJava 8
1.17Java 16 or newer
1.18 to 1.20.4Java 17
1.20.5 to 1.21.xJava 21
26.1 and newerJava 25

UnsupportedClassVersionError

The message means the jar was built for a newer Java than the one running it. The "class file version" tells you which: 52 is Java 8, 61 is Java 17, 65 is Java 21, 69 is Java 25.

Select the matching Java image in your server's startup settings, then restart.

Old modpacks

Many 1.12.2 and older modpacks require Java 8 and crash on newer versions. Keep the version the pack asks for.

Related