
The first fix in the post is the cause of everything after it.-Xmx512Min Windows system variables lands in_JAVA_OPTIONS, and Java reads that variable last, on every launch, over the top of whatever CurseForge asked for. Set to512Mit starves the pack; set to8192with no unit it means 8,192 bytes and Java refuses to start at all. Reinstalling Java and running as admin never touch it. Delete the variable, let CurseForge set memory in the profile, and UniversIO (Forge 1.19.2, Java 17) starts. The batch file below shows you the variable is there before you remove it, and the second one removes it.

The Error Hides Its Real Message One Line Up
“Could not create the Java Virtual Machine” is the last line Java prints. The line before it says why. Run from a Command Prompt, these are the four versions of the mistake, reproduced on OpenJDK 21 while writing this:
java -Xmx8192 -version
No unit after the number
Error occurred during initialization of VM
Too small maximum heap
java -XX:+UseConcMarkSweepGC -version
A flag from an old guide that Java 17 removed
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
java -Xms4G -Xmx512M -version
Launcher asks for 4 GB to start, your variable caps it at 512 MB
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size
java -Xmx6G -version (with _JAVA_OPTIONS=-Xmx512M set)
The variable wins. MaxHeapSize is 536,870,912 bytes, not 6 GB
Picked up _JAVA_OPTIONS: -Xmx512M
openjdk version "21.0.12.1" 2026-08-18
The fourth case is the quiet one. Java starts, prints “Picked up”, and the launcher gets 512 MB. Forge then dies loading mods with an out-of-memory crash, or the launcher’s own checks refuse the heap and show the same “could not create” dialog. The Picked up line is the proof the variable is in play.
Run jvm-check.bat And Read Section 1
Save this as jvm-check.bat on the desktop and double-click it. It prints the two variables, which java.exe answers, how much RAM the PC has, whether Java can start with a 4 GB and an 8 GB heap, and where CurseForge keeps its own Java.
@echo off
REM jvm-check.bat - finds why "Could not create the Java Virtual Machine" appears before Minecraft starts.
echo === 1. Java options forced on EVERY Java program (should both say "not set") ===
if defined _JAVA_OPTIONS (echo _JAVA_OPTIONS = %_JAVA_OPTIONS%) else (echo _JAVA_OPTIONS = not set)
if defined JAVA_TOOL_OPTIONS (echo JAVA_TOOL_OPTIONS = %JAVA_TOOL_OPTIONS%) else (echo JAVA_TOOL_OPTIONS = not set)
echo.
echo === 2. Which java.exe answers on this PC ===
where java 2>nul || echo (no java on PATH - fine, CurseForge brings its own)
java -version 2>&1
echo.
echo === 3. Installed RAM ===
wmic computersystem get TotalPhysicalMemory /value | find "="
echo.
echo === 4. Can Java start with the heap CurseForge asks for? ===
java -Xmx4G -version >nul 2>&1 && (echo -Xmx4G OK) || (echo -Xmx4G FAILED: & java -Xmx4G -version 2>&1 | findstr /i "error heap option")
java -Xmx8G -version >nul 2>&1 && (echo -Xmx8G OK) || (echo -Xmx8G FAILED: & java -Xmx8G -version 2>&1 | findstr /i "error heap option")
echo.
echo === 5. The Java that CurseForge actually uses ===
for /d %%d in ("%LOCALAPPDATA%\Programs\CurseForge Windows\runtime\*") do echo %%d
pause
- Section 1 showing anything but
not setis the fault. Go to Step 2. - Section 4 saying
-Xmx8G FAILEDwhile-Xmx4G OKmeans the PC can’t give 8 GB. Use 4 to 6 GB in Step 3. - Section 2 showing a 32-bit Java (
Client VMin the version line) can’t go above about 1.5 GB. Irrelevant to CurseForge’s bundled runtime, but it explains the standalone tests.
Remove the Variable With fix-env.bat, Then Sign Out
Right-click this one and choose Run as administrator. It clears _JAVA_OPTIONS and JAVA_TOOL_OPTIONS from both the user and the system environment. Programs read environment variables when they start, so sign out and back in before launching anything.
@echo off REM fix-env.bat - removes the Java variables that override every launcher. Run as administrator. setx _JAVA_OPTIONS "" >nul 2>&1 setx JAVA_TOOL_OPTIONS "" >nul 2>&1 reg delete "HKCU\Environment" /v _JAVA_OPTIONS /f >nul 2>&1 reg delete "HKCU\Environment" /v JAVA_TOOL_OPTIONS /f >nul 2>&1 reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v _JAVA_OPTIONS /f >nul 2>&1 reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v JAVA_TOOL_OPTIONS /f >nul 2>&1 echo Removed _JAVA_OPTIONS and JAVA_TOOL_OPTIONS from user and system environment. echo Close every open window, sign out and back in, then launch CurseForge again. pause
Prefer to do it by hand: press Win, type environment variables, open Edit the system environment variables → Environment Variables, and delete _JAVA_OPTIONS from both lists. Also open Path and remove any line that points to a Java folder you added while following the guide.
Set Memory Where CurseForge Reads It
- Open the CurseForge app → Settings (gear, bottom left) → Minecraft.
- Under Java Settings, drag Allocated Memory to 6144 MB on a 16 GB PC, 4096 MB on an 8 GB PC. Leave at least half the machine for Windows.
- In Additional Java Arguments, delete everything you pasted from guides. Leave the box empty. UniversIO’s own arguments ship with the pack.
- Make sure Java Version is the bundled one, not a path you set. Forge 1.19.2 needs Java 17, and the app installs that itself.
- Open the UniversIO profile → three dots → Profile Options and untick any per-profile memory override, so the global setting applies.
Launch. The first start of a 1.19.2 pack takes two to four minutes to load mods; a black window for that long is normal.
Still Failing? Pull the One Line That Names the Cause
CurseForge writes the full Java command and its first output to a log. This PowerShell line finds the newest log and prints the lines that matter:
$log = Get-ChildItem "$env:USERPROFILE\curseforge\minecraft\Instances\UniversIO\logs","$env:USERPROFILE\curseforge\minecraft\Install\logs" -Filter *.log -Recurse -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1 Select-String -Path $log.FullName -Pattern "Picked up|Unrecognized|heap|Could not|Error occurred" | Select-Object -First 8
| Line in the log | Meaning | Fix |
|---|---|---|
Picked up _JAVA_OPTIONS | Variable still set | Step 2 again, then sign out |
Unrecognized VM option | A flag Java 17 no longer has | Empty the Additional Java Arguments box |
Could not reserve enough space for object heap | Asked for more than Windows can hand over | Lower Allocated Memory; close Chrome before launching |
Too small maximum heap | Number with no unit | Use 6G or 6144M, never a bare number |
Initial heap size set to a larger value | -Xms above -Xmx | Remove any -Xms you added |
The Guides Weren’t Wrong Ten Years Ago
The “add -Xmx to system variables” advice dates from the old Mojang launcher, when Java was a single system-wide install and there was no other place to put a flag. Launchers now carry their own Java and their own memory slider, so a system-wide flag does nothing but fight them. The same goes for -XX:+UseConcMarkSweepGC and friends in copy-pasted “optimized arguments”: those collectors were removed in Java 14, and Forge 1.19.2 runs on 17. Anything that touches Java globally is the thing to undo first, which is the opposite of the order the post went in.
