在终端机中运行
sudo java -jar -Xdebug -Xrunjdwp:transport = dt_socket,server = y,suspend = n,address = 5005 MyJar.jar
它工作得很好,但是当我在bash脚本中调用它
case $1 in
start)
echo "Starting $SERVICE_NAME ..."
if [ ! -f $PID_PATH_NAME ]; then
nohup java -jar $PATH_TO_JAR ~/Desktop/myservice.log 2>&1 &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is already running ..."
fi
;;
失败!