Linux 环境使用shell脚本进行jar后台启动停止
新建启动脚本 start.sh, 键入内容
nohup java -jar test-0.0.1-SNAPSHOT.jar >/dev/null &
执行脚本 sh start.sh
新建停止脚本 stop.sh,键入内容
ps -ef |grep test-0.0.1-SNAPSHOT.jar|grep -v 'grep'|awk '{print $2}'|xargs kill -9
执行脚本 sh stop.sh
Linux 环境使用shell脚本进行jar后台启动停止
新建启动脚本 start.sh, 键入内容
nohup java -jar test-0.0.1-SNAPSHOT.jar >/dev/null &
执行脚本 sh start.sh
新建停止脚本 stop.sh,键入内容
ps -ef |grep test-0.0.1-SNAPSHOT.jar|grep -v 'grep'|awk '{print $2}'|xargs kill -9
执行脚本 sh stop.sh