[ACCEPTED]-Run Java application as a service-windows-services
There's an LGPL clone of the Java Service 7 Wrapper: http://yajsw.sourceforge.net
BTW, IANAL, but I suspect that 6 JSW people are spreading FUD, and their 5 software can be used to service-enable commercial 4 applications under GPL license, just like 3 one can gzip a commercial app for redistribution. I 2 could be completely wrong about this, though 1 :)
Another option, Apache Commons Daemon's 1 procrun.
A program that should run as windows service 9 must provide certain functions that the 8 windows service manager uses to communicate 7 with that service.
As long as there is no 6 JVM that implements this functions directly 5 (and I know of none) you will need some 4 kind of wrapper.
I have successfully used 3 srvany for a java based windows service (Basically 2 it allows to run any program as windows 1 service and it works fine with java)
You can use NSSM like this:
nssm install MyService "%JAVA_HOME%\bin\java.exe" -jar "path\to\the\file.jar"
I haven't tried it (yet), but Launch4j looks like 1 it could suit your needs.
one more option winrun4j. the license is eclipse's 1 CPL.
The most simple way I found was RunAsService.
A co-worker 2 recommended a tool called SC, but I did not 1 try it.
JSmooth can do it, and it is scriptable 1 with ant.
More Related questions