Java running as a Unix service

Vilius picture Vilius · Oct 13, 2010 · Viewed 29.7k times · Source

I have built a little daemon in Java and I would like to run it as a service under Unix (e.g. Debian 5). I have read that there is a possibility of using a Java wrapper, but isn't there any other option which is easier to implement? Can't I just use a Unix command such as xxx java -jar program.jar?

Answer

Chaitanya picture Chaitanya · Oct 13, 2010

Well, if you want to run your java program even when you exit out of your shell, the following is the most simple way:

$nohup java -jar program.jar &