Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you are not interested in having the service started/stopped at boot/shutdown, but you just want the program to be started manually and keep running after logout, here is what you do:</p> <pre><code>$ nohup java -jar foobar.jar &gt; foobar.log 2&gt;&amp;1 &amp; </code></pre> <p>which means: start my foobar.jar (java -jar) and keep it running after I logout (nohup) redirect stdout to foobar.log (>) and also the stderr (2>&amp;1), and make it running in background (&amp; at the end).</p> <p>Instead, if you are interested in installing a "service" in your linux box, there are many options, depending on what distribution you are using. The most common are <a href="http://upstart.ubuntu.com/" rel="nofollow noreferrer">upstart</a> (for ubuntu) and System V init scripts (Redhat or others). Also cron can be used to start/stop services at startup/shutdown. You can find an example of installing a java app (hudson) on an init system <a href="http://weblogs.java.net/blog/johnsmart/archive/2008/10/installing_huds.html" rel="nofollow noreferrer">here</a>, or doing the same thing with <a href="https://stackoverflow.com/questions/9330367/how-to-configure-jenkins-to-run-on-port-80">upstart</a>. Or, as I said, <a href="http://www.cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot/" rel="nofollow noreferrer">cron</a> could be an option.</p> <p>On Windows, there is <a href="http://wrapper.tanukisoftware.com/doc/english/introduction.html" rel="nofollow noreferrer">Java Service Wrapper</a>. And not much more.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload