Skip to content
GameVault

Java version errors in Minecraft

Fix UnsupportedClassVersionError and other crashes caused by running Minecraft or a mod loader on the wrong Java version.

Last verified

The problem

Fix UnsupportedClassVersionError and other crashes caused by running Minecraft or a mod loader on the wrong Java version.

Possible causes

  • The game or a mod needs a newer Java than the one being used.
  • An old Minecraft version (1.16.5 and earlier with Forge) running on a Java that is too new.
  • The launcher points to a system Java instead of the right runtime.

How to identify the cause

  • "class file version 61.0" means the code needs Java 17; 65.0 means Java 21; 69.0 means Java 25; 52.0 means Java 8.
  • The first lines of latest.log show which Java version the game started with.
  • AppClassLoader cannot be cast to class java.net.URLClassLoader means an old Forge is running on Java 9 or newer.

Step-by-step fix

  1. Find the Java version your Minecraft version needs. See Java versions for Minecraft.
  2. In the official launcher, leave the Java runtime on the bundled default unless a modpack says otherwise.
  3. In Prism Launcher or similar, set the Java path per instance in its settings.
  4. Install the required Java from a trusted vendor such as Eclipse Temurin or Microsoft Build of OpenJDK if your launcher does not provide it.
  5. Launch again and check the Java version at the top of the new log.

If that did not work

  • If one mod needs a newer Java than your old Minecraft version supports, that mod build is for a newer version. Find the build for your version.

Affected versions

All versions. Per Mojang's version manifest: up to 1.16.5 use Java 8, 1.17.x Java 16, 1.18 to 1.20.4 Java 17, 1.20.5 to 1.21.11 Java 21, and 26.1 and newer Java 25.

Frequently asked questions

Can I just install the newest Java?

For new Minecraft versions, usually yes. Old Forge versions break on new Java, so keep Java 8 available for them.

Do I need to uninstall other Java versions?

No. Several versions can be installed side by side. Point each instance to the right one.