Skip to content
Launcher

Which Java is needed for Minecraft and Java errors

Which Java each game version requires, what the launcher does with Java on its own, and how to fix UnsupportedClassVersionError and “Could not create the Java Virtual Machine”.

Updated October 24, 2026

You don't need to install Java manually: the launcher downloads the right version for each modpack itself. This article is for cases when something went wrong or Java was selected manually.

Which Java is needed for which game version

Minecraft versionJava
up to 1.16.5 inclusive8
1.17 – 1.20.417
1.20.5 – 1.21.x21
26.x25

Officially 1.17 asks for Java 16, but the launcher runs it on Java 17 — the game works on it.

Newer doesn't mean better: older versions with mods (for example, Forge 1.12.2) won't launch on Java 17 and above. Too old a Java won't launch a new version.

What the launcher does with Java on its own

  • It takes the Java that the game version asks for and downloads it on first launch. The archive is installed only after the checksum is verified and is placed in the launcher folder — your system Java and Windows settings are not changed.
  • If a suitable 64-bit Java is already installed on your computer, it may use it. The launcher does not select 32-bit Java: it doesn't have enough memory for modpacks.
  • If a too-old Java is selected manually, the launcher will warn “The selected Java … is too old for Minecraft …” and launch the game on a suitable one.

Where to select Java manually

  • For one modpack: open the modpack → “Settings” → expand “For advanced users” → the “Java” line. By default it's set to “Java version: auto” — the one the modpack asks for.
  • For all modpacks: Settings → Files → Java → “Java for all modpacks” → “Specify”. The “Reset” button returns to automatic selection.
  • Download a specific version: in the same place, in the “Download Java” line, select Java 8, 11, 17, 21 or 25 and click “Download”. Below is a list of downloaded versions; you can delete an unneeded one, and the launcher will download it again if needed.

If you're not sure — leave it on auto.

Java errors

UnsupportedClassVersionError

Text like has been compiled by a more recent version of the Java Runtime means that the mod or game was compiled for a Java newer than the one running. In the “Game crashed” window there will be “A different Java version is needed for this modpack” and a “Install Java …” button — click it and launch the game again.

If Java was selected manually, set “Java version: auto” back in the modpack settings.

“Could not create the Java Virtual Machine”

This is not the cause but a consequence: Java couldn't start. The real cause is in the line before it. The launcher shows it in the error window: “The game didn't start (code …): …”.

  • Unrecognized option or Multiple garbage collectors selected — an error in your own arguments. Clear the “JVM arguments” field in the “For advanced users” section.
  • Could not reserve enough space or Insufficient memory — Windows couldn't allocate the memory. Set less memory in the modpack, close your browser and check that the Windows page file is enabled. For more details, see the article How to allocate more RAM.
  • Could not find java.dll — Java is corrupted, most often its files were deleted by an antivirus. In this case the launcher reinstalls its own Java itself and tries to launch again. If the error remains, delete that Java in Settings → Files → Java and launch the game — the launcher will download it again. Add the launcher folder to your antivirus exclusions.

Wrong bitness

32-bit Java doesn't let the game use more than 1–1.5 GB of memory, and modpacks crash on it. If “Java for all modpacks” specifies 32-bit Java — click “Reset”, and the launcher will use its own 64-bit one.

Mac with an M chip

Versions before 1.19 launch through Rosetta. The launcher will offer to install it itself — confirm the installation with your macOS password.

If that didn't help

Follow the steps from the article The game crashes or shows a black screen — what to do. For Java for your server on hosting, see the article Java version for your core.