简体   繁体   中英

Shell Script not Starting java program [Debian]

I am using a shell script to run a minecraft server (based of forgecraft scripts) and I have got it working, but I then reset it to the correct java start line, at which point it stops. The line that is causing the trouble is this:

java ${MEMORY_OPTS} ${JAVA_OPTIONS} ${JMX_OPTIONS} -jar $SERVICE nogui

Using Java -Version returns the java version, and the error I get is that the server dosen't launch, but when I use this:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

it does.

The reason I need to change to the above one is so my check server java file works for tracking teh server. Thanks - Thomas

ps the script can be found here: http://pastebin.com/2b0ki2NX the check server java file and original script can be found here: https://github.com/pahimar/ForgeCraft-Script/blob/master/script/minecraft

更改JAVA_HOME似乎可以解决该问题。

The error is probably here:

screen -dmS mc$PORT $INVOCATION &

You probably need to pass the invocation command as a single argument:

screen -dmS mc$PORT "$INVOCATION" &

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM