Run JAVA as a Windows service (this howto is deprecated)Tag(s): DEPRECATED

A solution adapted to Java, is YAJSW( Yet Another Java Service Wrapper ) ( ) (opensource).

The setup is very simple with one configuration file and your Java service can be notified when the service is stopped.

If you log in and log out from a machine and a java service is running then the service may be stopped. The fix is to use Java 1.3.1 or higher and start the process with the JVM switch -Xrs (Reduce Signals Xtended-switch) to stop the Windows signal from killing the JVM.

For BEA JRockit, it's the -Xnohup

Also, it's possible to the utility SRVANY.EXE, included with the NT resource Kit.

SVRANY is used to run any EXE as a windows service. In our situation, SVRANY will run the specified JAVA.EXE with our class a parameter. But this solution presents many problems. For exemple, if you kill the SVRANY.EXE process (stop the service) then the JAVA.EXE is not killed, you need to do it manually.