If you use Ubuntu and have "Upstart" (http://upstart.ubuntu.com/).you can try the following:
Create /var/init/yourservice.conf
with the following content
description "Your Java Service" author "You" start on runlevel [3] stop on shutdown expect fork script cd /web java -jar server.jar >/var/log/yourservice.log 2>&1 emit yourservice_running end script
Now you can issue the service yourservice start and service yourservice stop . You can /var/log/yourservice.log to make sure it works.
If you just want to start your jar from the console without starting the console window, you can simply do:
java -jar /web/server.jar > /var/log/yourservice.log 2>&1
Strelok Aug 24 2018-12-12T00: 00Z
source share