编写一个可执行的startup.sh文件。如下: #!/bin/sh kill -9 `lsof -ti:8081` nohup java -jar xxxxx.jar --spring.profiles.active=prod &