Start script generator

Build a start.bat, start.sh, systemd unit or Docker command for any server jar: RAM, Aikar's flags, Java check and auto-restart.

Your script — Leaf 1.21 (needs Java 21)

#!/bin/sh
# start.sh — Leaf 1.21 (generated by MCJarHub)
cd "$(dirname "$0")"
JAVA_MAJOR=$(java -version 2>&1 | awk -F'"' '/version/ {split($2, v, "."); print (v[1] == "1") ? v[2] : v[1]}')
if [ "$JAVA_MAJOR" -lt 21 ] 2>/dev/null; then echo "Java 21 or newer is required (found $JAVA_MAJOR)."; exit 1; fi
java -Xms4G -Xmx4G -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar leaf-1.21.jar nogui

Put it next to the server file from Leaf 1.21. On Linux/macOS make it executable with chmod +x start.sh. Memory advice: RAM calculator.