每天學習一點點 編程PDF電子書、視頻教程免費下載:
http://www.shitanlife.com/code
直接用java -jar xxx.jar,當退出或關閉shell時,程序就會停止掉。以下方法可讓jar運行后一直在后台運行。
1. java -jar tw-cloud-bigscreen-web-1.1.1-exc.jar --eureka.client.serviceUrl.defaultZone=http://10.80.58.186:9100/eureka/ --twasp.config.uri=http://10.80.58.186:9300/configs --twpaas.bigscreen.zipkinurl=http://10.80.58.186:9400 --twpaas.bigscreen.chinamapurl=http://192.168.60.36:8001/showroom/front/first/map_pass &
說明: 在末尾加入 & 符號
2.
(1)java -jar tw-cloud-bigscreen-web-1.1.1-exc.jar --eureka.client.serviceUrl.defaultZone=http://10.80.58.186:9100/eureka/ --twasp.config.uri=http://10.80.58.186:9300/configs --twpaas.bigscreen.zipkinurl=http://10.80.58.186:9400 --twpaas.bigscreen.chinamapurl=http://192.168.60.36:8001/showroom/front/first/map_pass
(2)ctrl+z 退出到控制台,執行 bg
bg
(3) exit
完成以上3步,退出SHELL后,jar服務一直在后台運行。
3.
直接在java -jar xxxx.jar 加入 nohup&,也可以實現
nohup java -jar tw-bigscreen-service-0.0.1-SNAPSHOT.jar > ./console_output &
每天學習一點點 編程PDF電子書、視頻教程免費下載:
http://www.shitanlife.com/code