Run the jar package in Linux:
1. nohup java -jar demo-0.0.1-SNAPSHOT.jar &
2. ctrl+c
3. cat nohup.out
Close the jar package:
1. ps -aux |grep java
2 kill -9 xxxx (此处为jar包的运程号)
..
! ! ! Link link
The Linux service starts the jar package and closes the jar package process
. 1. In Linux, after the client is connected, the jar package is opened with java –jar ***. Jar. After the client is closed, the corresponding service is also closed.
解决方法:
前面加上nohup,列如:nohup java -jar gift.jar&
这样启动就不会随着关闭客户端而关闭服务了。
-
So how do you close this process?
-
After executing the nohup java -jar gift.jar & command, the PID will be returned to the window.
Remember, then execute kill -9 5314.
2. You can query the currently active process. ps -aux | grep java
and then find the corresponding process number, execute kill -9 5314