Server startup file
Own server
start.bat and start.sh with memory and flagsLearn more
The server jar does not run with a double click; next to it, you need the launch file. Collect it here: memory, flags and clues as Java needs.
My game select version
We'll remember in this browser and set up where your version is available. Open link settings are more important than this choice; the Vicki versions do not change.
Result
File · Start.batstart.bat Java 25
@echo off
cd /d "%~dp0"
java -Xms4G -Xmx4G -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 server.jar --nogui
pause
- Need Java
- 25 or newer
- Server memory
- 4 GB
- Free by car
- from 6 GB
Place it next to the jar and double-click it to run.
Pick up the start.batAre you running via panel or systemd?
One line
The panel (Pterodactyl, Pufferpanel) starts the server itself and asks for a command rather than a file: it does not accept a loop wrapper; restart is its work. The same line is suitable for a loop. screen and tmux.
java -Xms4G -Xmx4G -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 server.jar --nogui
How to use
- Place the file next to the jar
To the same folder, not to a neighboring one: the paths in the command are relative, and a server launched from another location will create a world where it was called from.
- Install the required Java
Number - as a result, on the file tab. Newer is possible, older is not possible: the server will respond UnsupportedClassVersionError. Check: java -version.
- Run
Place it next to the jar and double-click it to run.
- Accept the EULA
The first run will create eula.txt and stops: change eula=false on eula=true and run again.
About memory and flags
- -Xms is equal to -Xmx intentionally. This is what Aikar advises: the heap is taken as a whole at once and does not grow as the game progresses. Different values give pauses where the heap expands.
- Do not give the server all of your machine's memory. Paper documentation advises leaving 1000–1500 MB for the system and the JVM itself. Hence the line “free by car.”
- More is not better. Paper writes that a plagin server should give 6–10 GB regardless of the number of players, and 32 GBs were wasted money. Pufferfish recommends not giving one server more than 16 GB.
- The flags for the big pile are included themselves, above 12 GB. There is no separate button intentionally: Aikar writes “for 12 GB and less, these parameters do not need to be changed.”
- Without flags is also an option. PaperMC itself advises on Java 17 and later to first try launching without a single flag.
- The window closed instantly - the server crashed at the start. For this purpose in start.bat without restarting and costs pause: The window remains open along with the error text.
Flags checked against Aikar publication and PaperMC and Velocity documentation. Java requirements - from Minecraft Wiki and docs.papermc.io.
Frequently asked questions
Why won't the Minecraft server start when I double-click it?
The server jar doesn't run like this: you need a launch file that calls Java with the right arguments. This is the first thing they start up before eula.txt.
Why does the console window close immediately?
The server crashed at the start, and the window closed along with it, without showing an error. In .bat, a pause at the end helps - it will leave a message on the screen.
How much RAM should I allocate to the server?
Not everything on the car: the system should be left near the gigabyte. PaperMC advises a server with 6-10 GB plagins, regardless of the number of players, and calls 32 GB wasted.
