Run Java application as a service

ぃ、小莉子 提交于 2019-11-28 17:34:25

There's an LGPL clone of the Java Service Wrapper: http://yajsw.sourceforge.net

BTW, IANAL, but I suspect that JSW people are spreading FUD, and their software can be used to service-enable commercial applications under GPL license, just like one can gzip a commercial app for redistribution. I could be completely wrong about this, though :)

cpierceworld

Another option, Apache Commons Daemon's procrun.

See http://commons.apache.org/daemon/

A program that should run as windows service must provide certain functions that the windows service manager uses to communicate with that service.

As long as there is no JVM that implements this functions directly (and I know of none) you will need some kind of wrapper.

I have successfully used srvany for a java based windows service (Basically it allows to run any program as windows service and it works fine with java)

I haven't tried it (yet), but Launch4j looks like it could suit your needs.

one more option winrun4j. the license is eclipse's CPL.

You can use NSSM like this:

nssm install MyService "%JAVA_HOME%\bin\java.exe" -jar "path\to\the\file.jar"

The most simple way I found was RunAsService.

A co-worker recommended a tool called SC, but I did not try it.

JSmooth can do it, and it is scriptable with ant.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!