Run Java application as a service

前端 未结 8 1750
面向向阳花
面向向阳花 2020-12-13 07:21

I would like to run a Java application as a service. Unfortunately, I am limited in that I can\'t use something like the Java Service Wrapper (which does appear to be an ex

相关标签:
8条回答
  • 2020-12-13 07:39

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

    0 讨论(0)
  • 2020-12-13 07:40

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

    0 讨论(0)
  • 2020-12-13 07:44

    You can use NSSM like this:

    nssm install MyService "%JAVA_HOME%\bin\java.exe" -jar "path\to\the\file.jar"
    
    0 讨论(0)
  • 2020-12-13 07:47

    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 :)

    0 讨论(0)
  • 2020-12-13 07:49

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

    0 讨论(0)
  • 2020-12-13 07:50

    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)

    0 讨论(0)
提交回复
热议问题