Tutorials/OpenBSD startup script

From Kiiw
Revision as of 07:40, 26 December 2021 by 82.11.186.4 (talk) (Update Minecraft server download URL)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:ScriptWarning

Installation

  • Install the Java developer kit and the minecraft installer script
$ doas pkg_add jdk minecraft

Run minecraft and follow what it tells you to do via terminal, then run minecraft again to start Minecraft. The setup script will only run the first run after installation.

Do not change the executable location in your launcher profile as Minecraft will not launch, OpenBSD needs Minecraft to run from a set location to correctly work.

Running a server

Download the server java executable (.jar) from the Minecraft website, place it in a directory within your home directory (or wherever accessible), then cd to that directory and run:

$ java -Xmx1024M -Xms1024M -jar minecraft_server.jar --nogui

to start the server. You may want to write a shell file with:

$ nano minecraft_server.sh

then enter:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar --nogui

Press CTRL-X then Y to save. To make this runnable through a file explorer, use:

$ chmod +x minecraft_server.sh

Otherwise use:

$ sh minecraft_server.sh

Template:Tutorials

zh:教程/OpenBSD启动脚本