Minecraft Server Startup Script Generator
Make a start.bat or start.sh for your server with the right memory settings and Aikar's flags, the Java settings PaperMC recommends for smoother performance.
start.bat
Which Java do I need?
| Minecraft 26.1 and newer | A recent Java - check that version's release notes |
| Minecraft 1.20.5 to 1.21.x | Java 21 |
| Minecraft 1.18 to 1.20.4 | Java 17 |
| Minecraft 1.17 | Java 16 |
| Minecraft 1.16.5 and older | Java 8 |
If the server closes straight away with "UnsupportedClassVersionError", your Java is too old for that Minecraft version. Setting the minimum and maximum memory (-Xms and -Xmx) to the same value is intentional: Java grabs the memory once at start instead of resizing while players are online.
How to use the Startup Script Generator
- Enter how much RAM the server should use, in GB.
- Enter the name of your server jar file exactly as it appears in the folder.
- Choose Windows (start.bat) or Linux and Mac (start.sh).
- Choose Aikar’s flags or memory only, and whether the server should restart by itself if it stops.
- Download the script and put it in the same folder as the jar.
Common questions
What are Aikar’s flags?
A set of Java settings that tune how the server cleans up memory, so those clean-ups cause shorter pauses. They are the settings PaperMC recommends.
Why are the minimum and maximum memory set to the same value?
It is deliberate. Java takes the memory once when the server starts, instead of growing and shrinking it while people are playing, which avoids stutter.
The server closes straight away with UnsupportedClassVersionError. Why?
Your Java is too old for that Minecraft version. Minecraft 1.20.5 to 1.21.x needs Java 21, 1.18 to 1.20.4 needs Java 17, 1.17 needs Java 16, and 1.16.5 and older run on Java 8.
How do I run start.sh on Linux?
Make it runnable once with chmod +x start.sh, then start the server with ./start.sh.