Fix Java Virtual Machine Minecraft Errors in Java Edition
If Minecraft Java Edition closes with a Java Virtual Machine (JVM) error, start by checking the exact log message, then test the official launcher’s default settings, the memory limit, the Java runtime for that game version, and any mods or graphics changes. “Exit Code 1” by itself does not identify a cause. A message such as OutOfMemoryError: Java heap space, a failed JVM startup, and a native crash each call for a different check.
This guide reflects Minecraft’s 2026 Java release line, including Java Edition 26.3, released September 15, 2026. Java requirements and default JVM settings vary by game version and launcher, so use the version selected in your profile as the reference point.
What a Minecraft JVM crash means
The JVM is the runtime that executes Minecraft Java Edition. A crash can happen before the game window opens or while the game is loading a world. Common clues include an “unable to create the Java Virtual Machine” message, an OutOfMemoryError, a crash report, or a Java fatal-error log. None of these labels means that the computer’s processor is necessarily broken.
Check the relevant files before changing settings:
logs/latest.log records the most recent game session. In the default Windows game directory, look under %AppData%\.minecraft\logs; on macOS, the default is ~/Library/Application Support/minecraft/logs; on Linux, it is commonly ~/.minecraft/logs. A custom game directory changes these locations.
crash-reports may contain a report with a timestamp for a Minecraft-level crash.
- A file named like
hs_err_pid indicates a fatal JVM or native process failure. Its location can vary; use the path shown in the launcher output or the file itself.
Save a copy of the newest report before trying fixes. Note whether the failure began after a game update, a Java executable change, a new mod, a shader, or a change to JVM arguments.
Five checks to fix Java Virtual Machine Minecraft errors
1. Match the fix to the error message
Open the latest log and read the last section before the crash. Search for terms such as OutOfMemoryError, Could not create the Java Virtual Machine, UnsupportedClassVersionError, or a named mod, renderer, or library. The first specific error is usually more useful than the launcher’s exit code.
- Heap space exhausted: check the game’s maximum heap and the modpack’s requirements.
- Could not create the JVM: inspect custom JVM arguments, the selected Java executable, and whether the requested memory is available.
- Unsupported class version: the selected runtime may be too old for the game or mod loader.
- A mod or renderer is named: test without that mod, shader, or loader combination before changing system Java.
2. Restore sensible memory settings
In the Minecraft Launcher, open Installations, select the affected profile, choose Edit, and expand More Options to inspect JVM Arguments. The launcher may show other options in the same field. Keep a copy of the original arguments, and change only the memory value if you need to test it.
The -Xmx option sets the maximum Java heap. For example, -Xmx4G sets a 4 GB maximum; it does not guarantee that Minecraft will use all of it. Mojang’s 26.1 snapshot notes raised the default allocation to 4 GB, and the official help center also uses -Xmx4G as an example. If your profile already has an appropriate value, increasing it again may not help. Leave enough physical memory for the operating system and other programs, especially on a computer with limited RAM.
Do not paste a long list of “optimized” flags from an unrelated modpack, and do not set -Xms and -Xmx to large values just because the PC has that much RAM. For modpacks, follow the pack author’s current memory guidance. If the game fails immediately after an argument change, restore the saved original string or reset the profile to its default JVM arguments.
3. Use the Java runtime required by that installation
For the official launcher, first remove a custom Java executable path if you added one and test the launcher-managed runtime. A manually selected runtime can point to an outdated Java version, a 32-bit build, or a file that was moved during an update.
Check the requirement for the exact Minecraft version before installing Java manually. For example, Mojang states that Java Edition 1.20.5 requires Java 21; Java Edition 26.1 requires Java 25 and includes Microsoft OpenJDK 25. That means “install Java 21 for every version” is no longer safe advice. If you use a third-party launcher or a mod loader, confirm its supported runtime and architecture as well. Download Java only from its official publisher when a manual installation is actually needed.
4. Test a clean vanilla profile before removing files
Create a separate installation for the same game version and launch it without mods or shaders. Mojang’s launcher troubleshooting instructions recommend making a new Java installation to check whether an existing profile’s settings are involved. If the clean profile works, the likely cause is in the old profile’s arguments, loader, mods, resource packs, or configuration.
For a modded profile, close the launcher and temporarily move the mods and shader-pack folders to a backup location rather than deleting them. Confirm that every mod and its loader target the same Minecraft version. If vanilla works, restore compatible files in small groups until the crash returns; that narrows the conflict without risking your entire setup. Back up important worlds before opening them with another game version or changing loaders.
5. Check graphics software and reinstall only the profile
If logs point to rendering, update the graphics driver through the computer or GPU maker’s official support channel, then test with default video settings and no shader pack. Lowering render distance can help diagnose a performance problem, but it does not repair a broken Java runtime. Avoid adding undocumented flags such as -Dorg.lwjgl.opengl.Display.allowSoftwareOpenGL=true; they are not a general fix for current Minecraft versions and can obscure the real error.
If a clean profile works but the original installation still crashes, recreate that installation with the same game version and default settings. Keep your existing game directory and world backups intact while testing. Mojang’s launcher support article explains how a fresh Java installation can help identify a damaged profile or advanced setting.
What not to delete or change
- Do not delete world
region files as a routine crash fix. That can remove or damage world data.
- Do not assume every crash is caused by insufficient RAM or that allocating more memory will fix driver, mod, or runtime errors.
- Do not replace Java files inside the official launcher’s managed runtime folders. Use the launcher’s settings or a supported installer instead.
- Do not use a Bedrock Edition fix for a Java runtime crash; this JVM troubleshooting applies to Java Edition.
When the crash continues
Keep the crash report, latest.log, Minecraft version, operating system, Java version if manually selected, and a list of mods or shaders. Remove account tokens and other personal information before posting logs publicly. If a fresh vanilla profile also crashes, follow Minecraft’s official graphics and launcher troubleshooting pages or contact Minecraft Support with the report. Avoid posting a full log that contains private paths or credentials.
Official references