简体   繁体   English

Shell脚本未启动Java程序[Debian]

[英]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. 我正在使用Shell脚本来运行Minecraft服务器(基于forgecraft脚本),并且可以正常运行,但是随后将其重置为正确的Java起始行,此时它将停止。 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 -Version返回Java版本,我得到的错误是服务器没有启动,但是当我使用它时:

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. 我需要更改为以上内容的原因是为了使我的检查服务器Java文件可用于跟踪服务器。 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 ps脚本可以在这里找到: http : //pastebin.com/2b0ki2NX检查服务器Java文件和原始脚本可以在这里找到: https : //github.com/pahimar/ForgeCraft-Script/blob/master/script/我的世界

更改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" &

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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