Xshell关闭导致jar服务终止,使Jar在CentOS后台运行

环境:Xsehll6,CentOS7

 

在项目文件夹新建一个runjar.sh

在sh中写入(举例说明)

nohup java -Dfile.encoding=UTF-8 -jar fin-mgmt-20180701.jar --spring.profiles.active=dev --server.port=8004 &

 

再运行脚本./runjar.sh

查看jar是否运行

ps -ef|grep java

 

关闭Xshell,服务仍在

 

posted @ 2018-07-01 16:05  Rest探路者  阅读(2050)  评论(0编辑  收藏  举报
levels of contents