在jar包目录下创建一个文件,后缀为 .sh

#!/bin/bash
# stop service
pid=`ps -ef | grep "jar包名字" | grep -v "tail" | grep -v "grep" | awk '{print $2}'`
if [ "$pid" ];then
echo "pid is $pid"
kill -9  "$pid"
else
echo "server already stopped!"
fi
nohup java -jar jar包名字.jar &

 

把jar包名字替换成自己实际的即可,这是nohup是后台启动ja包

相关文章:

  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2021-09-17
  • 2021-08-25
  • 2022-01-13
  • 2022-01-30
猜你喜欢
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案