1. touch start.sh,内容如下:
#!/bin/bash pid=`jps|grep jar` echo $pid for id in $pid do { kill -9 $id echo "kill $id" sleep 1 } & done sleep 1 echo "消灭了所有java线程..." echo "准备启动应用" nohup java -jar -Xmx10240m -Xms10240m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9988 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false xx.jar & tail -f nohup.out
2.授权
chmod u+x