How do you restart a Minecraft server using Java?

How do you restart a Minecraft server using Java?
3 Answers

Create a new startup script (start.sh) in the server directory to launch the JAR: #!/bin/sh screen -d -m -S “minecraft_screen” java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui.
Open your terminal and execute the following in the directory: chmod +x start.sh.
Run your start up script: ./start.sh.

3 Answers
  1. Create a new startup script (start.sh) in the server directory to launch the JAR: #!/bin/sh screen -d -m -S “minecraft_screen” java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui.
  2. Open your terminal and execute the following in the directory: chmod +x start.sh.
  3. Run your start up script: ./start.sh.