
Aikar's flags are the JVM arguments PaperMC recommends for Minecraft servers, and the line in Paper's docs is character for character the same as in June 2022, when Minecraft 1.19 ran on Java 17. Minecraft 26.1 and newer will not start on anything older than Java 25, so the fair question is whether that line still holds. We checked every flag in it against the JDK 25 documentation and source code.
Quick answer: Aikar's flags still work on Java 25. JDK 25 accepts every flag in the line without a warning, so the same JVM arguments serve Minecraft 1.20.5 to 1.21.11 on Java 21 and Minecraft 26.1 to 26.3 on Java 25. Three of them only repeat a default: MaxGCPauseMillis=200, G1HeapWastePercent=5 and ParallelRefProcEnabled, which G1 switches on by itself and JDK 26 deprecates. Set -Xms and -Xmx to the same value, about 1000 to 1500 MB below your server's memory, and put every flag before -jar.
Which Java Version Your Minecraft Server Needs
Mojang's version file for each release lists the Java version it runs on:
| Minecraft version | Java version |
|---|---|
| 26.1 to 26.3, including 26.1.1, 26.1.2 and 26.2 | Java 25 |
| 1.20.5 to 1.21.11 | Java 21 |
| 1.20.4 | Java 17 |
Paper's own table recommends Java 21 for all of its 1.20 to 1.21.11 builds and Java 25 for 26.1 and newer, and its launcher enforces the second part. On an older Java it stops with this message:
Minecraft 26.1 and newer requires running the server with Java 25 or above. For information on how to update Java, see https://docs.papermc.io/misc/java-install
Older releases, Fabric and NeoForge are covered in our Java version guide. Running All The Mods 10? Use our ATM10 JVM arguments guide; this page is the general one.
Aikar's Flags: The Full Line
This is the line from PaperMC's Aikar's flags page, last updated 18 September 2026, for a 10 GB heap:
java -Xms10G -Xmx10G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar --nogui
Change both 10G values to your heap size and paper.jar to your jar's file name. Paper's start script generator writes the same flags at every memory size. The two -D entries at the end only set Java system properties; they are not garbage collector settings. Earlier versions of this guide left them out, and the line above now matches Paper's.
Java 25 Arguments for Minecraft 26.1 to 26.3
So what should the Java arguments be for Minecraft 26.3 on Java 25? The line above. No flag in it is deprecated, obsolete or removed in JDK 25, and the three experimental ones still need -XX:+UnlockExperimentalVMOptions in the same line. The useful question is which of them still change anything. Here is each value next to what JDK 25 picks by itself, from the JDK 25 java documentation and the HotSpot source:
| Flag | Aikar's value | JDK 25 default | On Java 25 |
|---|---|---|---|
-Xms, -Xmx | Same value | 1/64 and 1/4 of physical memory | Sets the heap |
-XX:+UseG1GC | On | G1 with 2 or more processors and at least 1792 MB, Serial otherwise | Keeps G1 on small machines |
-XX:+ParallelRefProcEnabled | On | On when G1 runs more than one parallel GC thread | Repeats the default; deprecated in JDK 26 |
-XX:MaxGCPauseMillis | 200 | 200 | Repeats the default |
-XX:+UnlockExperimentalVMOptions | On | Off | Needed for the three experimental flags |
-XX:+DisableExplicitGC | On | Off | Changes the default |
-XX:+AlwaysPreTouch | On | Off | Changes the default |
-XX:G1NewSizePercent | 30 | 5 | Changes the default (experimental) |
-XX:G1MaxNewSizePercent | 40 | 60 | Changes the default (experimental) |
-XX:G1HeapRegionSize | 8M | Heap divided by 2048, rounded up to a power of 2 | Changes it at 8 GB or less and above 16 GB |
-XX:G1ReservePercent | 20 | 10 | Changes the default |
-XX:G1HeapWastePercent | 5 | 5 | Repeats the default |
-XX:G1MixedGCCountTarget | 4 | 8 | Changes the default |
-XX:InitiatingHeapOccupancyPercent | 15 | 45 | Starting value only |
-XX:G1MixedGCLiveThresholdPercent | 90 | 85 | Changes the default (experimental) |
-XX:G1RSetUpdatingPauseTimePercent | 5 | 10 | Changes the default |
-XX:SurvivorRatio | 32 | 8 | Changes the default |
-XX:+PerfDisableSharedMem | On | Off | Changes the default |
-XX:MaxTenuringThreshold | 1 | 15 | Changes the default |
JDK 21 accepts every flag in the line too and has the same defaults for all of them, so one line serves both versions.
Three flags repeat a default. G1's pause goal is already 200 ms, G1HeapWastePercent already defaults to 5, and G1 turns on parallel reference processing by itself whenever it runs more than one parallel GC thread. The OpenJDK issue that deprecates ParallelRefProcEnabled in JDK 26 says "there is little reason to disable it in modern usage", and the plan is to make it obsolete in JDK 27. On Java 21 and 25 the three change nothing, so they can stay. On JDK 26 or newer, remove -XX:+ParallelRefProcEnabled, because deprecated options print a warning.
G1HeapRegionSize=8M depends on your heap. Without it, JDK 25 divides the maximum heap by 2048 and rounds up to a power of two. On 8 GB or less that gives 4 MB or less, so the flag at least doubles the region size. Paper's reason for it: allocations of half a region or more count as "Humongous", go straight to the old generation and are harder to free. From just above 8 GB up to 16 GB, G1 picks 8 MB by itself and the flag changes nothing; above 16 GB it makes regions smaller than G1 would.
InitiatingHeapOccupancyPercent=15 is a starting value. G1 starts its first concurrent marking cycles at 15% old generation occupancy instead of 45%. After three completed marking cycles it calculates its own threshold, because adaptive IHOP is on by default.
To see the defaults on your own Java, print the final values:
java -Xmx10G -XX:+UseG1GC -XX:+PrintFlagsFinal -version | grep -E 'MaxGCPauseMillis|G1HeapWastePercent|ParallelRefProcEnabled|G1HeapRegionSize'
On a multi-core machine with JDK 25 that should show G1HeapRegionSize 8388608 (8 MB, from the 10 GB heap), G1HeapWastePercent 5, MaxGCPauseMillis 200 and ParallelRefProcEnabled true.
ZGC, Compact Headers and GraalVM on Java 25
- ZGC: on Java 25,
-XX:+UseZGCalone runs generational ZGC.-XX:+ZGenerational, which Java 21 needs, has been obsolete since JDK 24: Java 25 ignores it with a warning, and JEP 490 says a later release will refuse to start with it. ZGC replaces the G1 flags instead of adding to them; when it is worth testing is in our ZGC vs G1GC guide. - Compact object headers:
-XX:+UseCompactObjectHeadersbecame a product option in JDK 25 (JEP 519), so it no longer needs the experimental switch. It is off by default, and the JDK 25 documentation says it "reduces memory footprint in the Java heap by 4 bytes per object (on average) and often improves performance." It is not part of Aikar's set and Paper's docs do not mention it, so test it on a copy of your server with spark reports before and after. - GraalVM: Oracle GraalVM 25 is based on Oracle JDK 25, so it meets the Java 25 requirement; GraalVM releases based on older JDKs cannot run 26.x. Whether it runs your server faster than a standard JDK 25 is something to measure on your own setup. Our GraalVM guide covers the switch.
How Much Memory to Give Java (-Xms and -Xmx)
- Set
-Xmsand-Xmxto the same value. - Leave room for Java itself and the operating system. Paper's rule is to take 1000 to 1500 MB off the memory you have, so 6500 MB on an 8 GB server, to avoid running out of memory or having the out-of-memory killer stop the server.
- Paper recommends at least 6 to 10 GB with these flags, however few players you have, and warns that past a certain point more memory brings diminishing returns.
- Without
-Xmx, JDK 25 caps the heap at a quarter of the machine's physical memory, so always set it yourself.
For sizing by players and mods, see how much RAM a Minecraft server needs.
The Over-12 GB Variant Is Gone
Older copies of Aikar's flags, this page included until this update, listed a second set for heaps above 12 GB: G1NewSizePercent=40, G1MaxNewSizePercent=50, G1HeapRegionSize=16M, G1ReservePercent=15 and InitiatingHeapOccupancyPercent=20. PaperMC's docs carried that set until February 2024. After a user reported that Paper's start script generator ignored it, a pull request to add it to the generator was closed without merging, and Paper removed the set from its page instead. The generator now writes one set for every size up to its 24 GB maximum. If you run 12 GB or more and spark shows GC pauses lining up with your lag, test ZGC rather than the old variant.
Where to Put the Flags
Every flag goes between java and -jar. Java passes everything after -jar paper.jar to the server as its own arguments, so a JVM flag placed after the jar name never reaches Java.
In a hosting panel, look for the startup or JVM arguments field. In Pterodactyl, Paper's install guide changes the Java version under Docker Image in the Startup tab; choose Java 25 for 26.x. On Space-Node you set JVM arguments and pick the Java version in the Startup tab on every plan, and our performance hosting page lists this same flag set.
On your own machine or VPS, save the line as start.sh:
#!/usr/bin/env sh
java -Xms10G -Xmx10G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar --nogui
Then run chmod +x start.sh once and start the server with ./start.sh. On Windows, put the same java line in start.bat with pause on the line after it, the way Paper's generator writes it, so the window stays open when the server stops.
Check What the Flags Change
These flags tune memory and garbage collection, so they only help when GC is what slows the server. Check that before and after a change. Paper has bundled the spark profiler since 1.21:
/spark tpsprints TPS and CPU usage./spark gcprints the server's garbage collection history, and/spark gcmonitorswitches spark's GC monitoring on and off./spark profiler start --timeout 600records for 10 minutes and then returns a link to the report.
If long GC pauses don't line up with your lag spikes, the cause is elsewhere and no flag will fix it. For a record you can keep, Paper gives a GC logging flag for Java 11 and newer and says it "does not hurt your performance and can be left on at all times":
-Xlog:gc*:logs/gc.log:time,uptime:filecount=5,filesize=1M
Add it to the line before -jar. The logs folder has to exist already, which it does once the server has run; otherwise Java stops at startup with an Invalid -Xlog option error. Flags also cannot touch crashes outside Java, such as exit code -1073740791.
What Each Flag Does
Heap. -Xms sets the starting heap and -Xmx the maximum. Paper's advice is to keep them equal: the server should be expected to use the whole -Xmx anyway, and G1 works better with more memory.
Young generation. Minecraft allocates memory fast, mostly short-lived objects; Paper's page puts it at "at least 800MB/second on a 30 player server". G1NewSizePercent=30 and G1MaxNewSizePercent=40 keep the young generation between 30 and 40% of the heap instead of G1's 5 to 60%, so young collections come less often and short-lived objects have time to die young. MaxTenuringThreshold=1 moves anything that survives two young collections to the old generation instead of copying it between survivor spaces up to 15 times, and SurvivorRatio=32 shrinks the survivor spaces, which now hold less.
Old generation. G1MixedGCLiveThresholdPercent=90 lets old regions that are up to 90% live join mixed collections, and G1MixedGCCountTarget=4 aims to finish that cleanup within 4 mixed collections instead of 8. G1ReservePercent=20 keeps 20% of the heap free, so G1 is less likely to run out of space to copy objects into, which Paper calls to-space exhaustion.
Pauses. MaxGCPauseMillis=200 is a goal, not a fixed pause; Paper describes it as "aiming for at most loss of 4 ticks". G1RSetUpdatingPauseTimePercent=5 lets G1 spend 5% of a pause on remembered set updates instead of 10%, moving more of that work outside the pause. -XX:+DisableExplicitGC ignores System.gc() calls, which Paper says many plugins make, each one triggering a full collection.
Operating system. -XX:+AlwaysPreTouch makes the JVM touch every heap page at startup instead of as the heap fills up. -XX:+PerfDisableSharedMem stores the JVM's performance data in standard memory; Paper's reason is that without it, GC writes to the file system, which can cause major latency when disk I/O is high.
FAQ
What does "Minecraft 26.1 and newer requires running the server with Java 25 or above" mean?
Paper's launcher checks the Java version before it starts the server and stops on anything older than Java 25. Switch the server to Java 25: in Pterodactyl, choose the Java 25 image in the Startup tab; on your own machine, install a JDK 25 and check that java -version reports version 25 and a 64-Bit VM. Your flags can stay as they are.
Which Java 25 build is best for Minecraft? Any OpenJDK 25 build runs the server. For the game itself, Mojang's 26.1 Snapshot 1 notes say the included Java is now the Microsoft Build of OpenJDK 25. Paper's install guide uses Amazon Corretto because it "offers the best installation experience on the most platforms", names Eclipse Adoptium, Microsoft and Azul Zulu as alternatives, and calls Oracle's own JDK functionally identical but not recommended because of its installer and past licensing. Since they are all builds of OpenJDK, the same flags apply.
Should I use 16M regions on a 12 GB heap?
No. 16M belonged to the over-12 GB variant that Paper dropped in 2024, and Paper's line uses 8M at every size. On a 12 GB heap, JDK 25 already picks 8 MB regions by itself (12 GB divided by 2048 is 6 MB, rounded up to 8 MB), so G1HeapRegionSize=8M changes nothing there either.
What Xms and Xmx values should I use?
The same value for both, 1000 to 1500 MB below your server's memory: Paper's example is 6500 MB on 8 GB, and it recommends at least 6 to 10 GB with these flags. Without -Xmx, JDK 25 caps the heap at a quarter of the machine's memory.
Will Aikar's flags stop lag spikes?
Only the ones caused by garbage collection. Run /spark gc and a spark profile first. If GC pauses line up with the spikes, the flags help, and on a heap of 12 GB or more ZGC is the next thing to test. Spikes from plugins, entities or chunk generation need a different fix.
Sources
All opened on 31 October 2026:
- Mojang: version manifest and the version files for 26.3, 26.2, 26.1, 1.21.11, 1.20.5, 1.20.4 and 1.19; Minecraft 26.1 Snapshot 1 (16 December 2025)
- PaperMC docs: Aikar's flags, Getting started, Installing or updating Java, Start script generator and its source, Profiling
- PaperMC on GitHub: the June 2022 version of the flags page, docs issue 298, pull requests 299 and 300, and Paperclip's Java check
- Oracle JDK 25 documentation: the java command, GC ergonomics
- OpenJDK source, JDK 25: g1_globals.hpp, gc_globals.hpp, globals.hpp, g1Arguments.cpp, g1HeapRegion.cpp, arguments.cpp, logFileOutput.cpp; JDK 21: g1_globals.hpp, arguments.cpp; JDK 26: arguments.cpp
- OpenJDK: JDK-8359924 and its CSR JDK-8359925, JEP 490, JEP 519
- GraalVM: GraalVM 25 release notes
- spark: command usage