linux springboot .jar文件指定在后台运行

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012946310/article/details/82491489

在后台运行springboot jar项目:

nohup java -jar /www/springboot_demo.jar --spring.profiles.active=test > /www/springboot_demo.log 2>&1 &

或者指定端口号运行:

nohup java -jar /www/springboot_demo.jar --spring.profiles.active=test --server.port=8080 > /www/springboot_demo.log 2>&1 &

备注:

--spring.profiles.active=test // 指定运行环境(如果有配置多环境)
--server.port=8080 // 指定运行端口号
> /www/springboot_demo.log // 日志输出路径

猜你喜欢

转载自blog.csdn.net/u012946310/article/details/82491489