Java Arguments
Java arguments (JVM flags) let you fine-tune how Minecraft runs. Access them via Settings → Java Arguments.
Common Arguments Explained
| Argument | Effect |
|---|---|
-Xmx2G | Sets maximum heap size to 2GB |
-Xms512M | Sets initial heap size to 512MB |
-XX:+UseG1GC | Use G1 garbage collector — better for Minecraft |
-XX:MaxGCPauseMillis=200 | Target max GC pause of 200ms (reduces lag spikes) |
-XX:+DisableExplicitGC | Prevents mods from forcing garbage collection |
-Dfml.ignoreInvalidMinecraftCertificates=true | Fixes some Forge launch errors |
Arguments to Avoid
| Argument | Why to Avoid |
|---|---|
-XX:+UseZGC | Not available on all JDK/Android combos |
-XX:+UseShenandoahGC | Limited support on Android |
Version-Specific Notes
- Minecraft 1.16 and below: Use OpenJDK 8.
- Minecraft 1.17+: OpenJDK 17 or 21 required.
- Minecraft 1.21+: OpenJDK 21 recommended.
If you're unsure, leave the arguments at their defaults. Only change them if you're experiencing specific performance or crash issues.