TCLauncher

TCLauncher › All guides

Java errors when launching Minecraft

“Unsupported class file major version”, “Java not found”, “Could not create the Java Virtual Machine” — what Java errors mean and how to get rid of them.

Updated:

Java errors when launching Minecraft — TCLauncher

Minecraft: Java Edition runs on top of Java, and most strange startup errors are a mismatch between the game version and the Java version. Here's how to recognise the most common ones.

Which Java you need

  • Minecraft 1.16.5 and older — Java 8.
  • 1.17 — Java 16.
  • 1.18 — 1.20.4 — Java 17.
  • 1.20.5 and newer — Java 21.

TCLauncher downloads the right Java by itself and keeps several versions side by side — a 1.12.2 instance gets Java 8 and a 1.21 one gets Java 21. So the simplest cure for most errors below is to switch back to automatic Java in the instance settings. More — which Java Minecraft needs.

“Unsupported class file major version 65”

The number tells you which Java is needed: 52 — Java 8, 60 — Java 16, 61 — Java 17, 65 — Java 21. The error means the game or a mod was built for a newer Java than the one running. The fix: a newer Java. It also happens the other way round — old Forge crashes on new Java with errors about ClassCastException or modules: it needs Java 8.

“Could not create the Java Virtual Machine”

Java couldn't start with the given parameters. Most often:

  • More memory is set than you have — for example, 16 GB on a computer with 8 GB.
  • 32-bit Java with more than 1–1.5 GB of memory. You need 64-bit.
  • A mistake in the JVM arguments — an extra space, an unknown parameter. Clear the “JVM arguments” field.

“Java not found”

In ordinary launchers this means Java isn't installed or its path is wrong. In TCLauncher Java is downloaded automatically; if the error still appears, an antivirus has probably deleted the Java files. Add the launcher folder to the exclusions and start the instance again — Java will be downloaded anew.

“Error: Invalid maximum heap size”

Memory is set incorrectly in the -Xmx parameter, for example -Xmx4 instead of -Xmx4G. In TCLauncher memory is set with a slider, so this error doesn't happen — but it can come from copied JVM arguments.

When a custom Java makes sense

Sometimes experienced players use a different Java build for performance or compatibility with a specific mod. Do this only for a particular instance and only when you know why. If something broke after the change, switch back to automatic Java.

Download TCLauncher — the right Java for each version is installed automatically.

FAQ

Do I need to install Java separately for Minecraft?

With TCLauncher, no. It downloads the right Java for each game version by itself and keeps several side by side.

What does “major version 65” mean?

That the game or mod was built for Java 21. Run the instance with Java 21 — the launcher does this automatically for 1.20.5 and newer.

Why won't old Forge start on new Java?

Forge for 1.16.5 and older is made for Java 8 and crashes on newer ones. Switch back to automatic Java in the instance settings.

Download TCLauncher