Skip to content
Minecraft

Minecraft "Exit Code: 0": the cause is in the log

Minecraft closes with "Exit Code: 0" or "The game crashed unexpectedly". How to open the log, which line to look for and which fix matches each one (mods, RAM, Java, graphics drivers), plus the Java-per-version table.

4 minHow we make our guides

Fix it step by step
Quick answer

"Exit Code: 0" only says the game closed. The cause is in the log: open the .minecraft\logs folder, open latest.log and look for the last lines with ERROR or Exception. Most of the time it's an incompatible mod; after that, allocated RAM or the wrong Java version.

Illustration of the problem: Minecraft Exit Code 0
GlitchFix illustration: what this problem usually looks like.

Step 1: open the log (2 minutes)

  1. Press Windows + R, type %appdata%\.minecraft and press Enter.
  2. If there's a crash-reports folder, open the newest file. If not, go into logs and open latest.log with Notepad.
  3. Go to the end and scroll up to the first line with ERROR, FATAL or Exception. That's your clue.

If you use CurseForge, Prism, Modrinth or another launcher, each instance has its own folder: right-click the instance → Open folder.

Step 2: find your line in this table

What the log saysWhat it meansFix
requires, Missing or unsupported mandatory dependencies, Incompatible mods foundA mod needs another mod or a different versionInstall the dependency it names, or the mod version for your Minecraft version
Mixin apply failed or a mod name in the errorThat mod clashes with anotherRemove it and test; if the game starts, look for a newer version
java.lang.OutOfMemoryErrorNot enough RAM allocatedRaise the RAM (Step 3)
UnsupportedClassVersionError, class file versionJava is too oldUse the Java version from the table in Step 4
GLFW error 65542, Pixel format not acceleratedOld graphics driver, or the game is on the integrated GPUUpdate the driver and force the dedicated GPU
Nothing odd, and it closes when opening a worldDamaged world or settingsTry a new world; if it works, back up your world and delete options.txt
Two pink plastic building bricks on a light background
Mods are like bricks: if one doesn't fit the game version or another brick, the whole thing collapses at launch.

If you suspect a mod and the log doesn't name it

Split in halves: move half the mods out of the mods folder and launch. If it works, the culprit is in the half you removed; if not, it's in the half you kept. Repeat with that half. With 100 mods you'll find it in about 7 tries.

Step 3: the right amount of RAM (not too little, not too much)

Memory bar with three zones: red up to 4 GB, green between 4 and 8 GB with a blue arrow at 6 GB, and yellow from 8 to 16 GB
With a few mods, 4 GB is plenty; big modpacks need 6–8 GB. Going above 8 GB often causes stutters from Java's memory clean-up.
  • Official launcher: Installations → your installation → More options → JVM arguments. Change -Xmx2G to -Xmx6G (6 GB).
  • CurseForge, Prism or Modrinth: the instance settings have a memory slider.
  • Don't allocate more than half your PC's RAM. With 8 GB in total, give Minecraft 4 GB and close your browser. If system memory is already maxed out, see RAM at 100%.

Step 4: the right Java version

Minecraft versionJava it needs
1.16.5 and olderJava 8
1.17Java 16
1.18 to 1.20.4Java 17
1.20.5 and newerJava 21

The official launcher ships its own Java, so there's nothing to change. Third-party launchers sometimes use the Java installed in Windows: in the instance settings, pick the version from the table.

Step 5: if the log mentions graphics

  • Update the driver from the NVIDIA, AMD or Intel website (not through Windows Update).
  • On laptops with two GPUs: Settings → System → Display → Graphics → add the launcher's javaw.exe and choose High performance.
  • If you use shaders, remove them to test: they're the most common cause of crashes while loading a world.

Frequently asked questions

Doesn't "Exit Code: 0" mean everything went fine?

In programming, 0 means "normal exit", but Minecraft sometimes shows it even when the game closed because of a crash. That's why you need the log.

Vanilla Minecraft crashes too. What now?

Check Steps 4 and 5: Java and graphics driver. If nothing changes, create a new installation in the launcher to rule out broken settings.

Will I lose my worlds if I reinstall?

Worlds live in the saves folder. Copy it somewhere else before reinstalling and you won't lose anything.

If you can't make sense of the log, copy its last 20 lines and send them to us via the contact page.

Still not fixed?

Email us at glitchfixesp@gmail.com with your device model, the exact error message and what you have already tried from this guide. We reply personally (in English or Spanish) and, if the issue keeps coming up, we add the new fix to the guide.

Send us your error

Related guides

See all Video games guides