Direct answer

Put the start script in the same folder as the server JAR and make the filename in -jar match exactly. For a server JAR named paper.jar, use the examples below.

Windows: start.bat

@echo off
java -Xms2G -Xmx4G -jar paper.jar --nogui
pause

Save the file as start.bat, not start.bat.txt. The final pause keeps the window open after a crash so you can read the error.

Linux or macOS: start.sh

#!/usr/bin/env sh
exec java -Xms2G -Xmx4G -jar paper.jar --nogui

Then make it executable and run it:

chmod +x start.sh
./start.sh

What Xms and Xmx do

-Xms is the initial heap size and -Xmx is the maximum heap size. More RAM is not automatically faster. Leave enough memory for the operating system, filesystem cache, panel, proxy, database, and anything else on the machine.

The JAR name must match

If the downloaded file is named paper-26.1-123.jar but the script says paper.jar, Java cannot find the file. Either rename the JAR to paper.jar or update the script to use the real filename.

Do not double-click the JAR as your normal workflow

A script gives you predictable Java arguments, RAM settings, and logs. It also makes later maintenance easier because you can update one command rather than trying to remember how the server was launched.

Official references

These references were checked while preparing this guide. Version-specific behavior can change, so use the project documentation for your exact release when a detail differs.

Was this article helpful?
Help us improve this article

Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.

What could we improve?
Do not include passwords, server IPs, or other private information.0 / 1000