Server crashe because of EULA

Hi, guys I figure it out. This EULA’s fault, because there are two places contain:

  1. the folder that I configure the server.
  2. the default folder in terminal.
    If I start the server directly, the server will use the folder that I made for server. However, when I was using the command ‘_java -jar /Users/guanzd/Desktop/189server/forge-1.8.9-11.15.1.1902-1.8.9-universal.jar _’ It make the server using the default folder.
    So guys if you want to use shell script to start your server. Please do make sure that you are in the correct folder.
    Here is my script after modifying:
    cd /Users/g******/****op/189server
    java -Xmx1024M -Xms1024M -jar forge-1.8.9-11.15.1.1902-1.8.9-universal.jar

Finally, thank you soooo much for your help!
BTW: I am using OSX. If you get the same error, please do not hesitate. :slight_smile:

For mac script should look something like this

#!/bin/bash
cd "$(dirname "$0")"
exec java -Xmx1024M -Xms1024M -jar forge-1.8.9-11.15.1.1902-1.8.9-universal.jar

Thanks!But why do we need to add something after ‘cd’?
“$(dirname “$0”)”

Ensures the script is executed in the directory it’s located. Doing it this way gives more flexibility. For example if the scenario ever came up where the server directory needed to be relocated or the directory renamed, the script would still work without the need to edit it.

Also note that the instructions TrenTech gave are for Mac OSX

the equivalent in windows would be

cd %~dp0

1 Like

or, since it’s windows and the problem is about relocating, you could just make a junction point