10

I'd like to install a Java application as a Windows service. I did so successfully a couple of years ago using this Java Service wrapper. Unfortunately, it seems like this tool is not in development anymore and thus no Windows 7 and 64 bit versions are available. I need to install my Java application on Windows 7 and XP machines.

Does anyone know a good alternative?

Edit: I need this for commercial use; the suggested Java Service Wrapper from Tanuki is too expensive.

RustyTheBoyRobot
  • 5,670
  • 4
  • 33
  • 53
mort
  • 10,940
  • 14
  • 45
  • 92
  • 3
    A few ideas in here: http://stackoverflow.com/questions/68113/how-to-create-a-windows-service-from-java-app – assylias Feb 13 '12 at 14:21
  • 1
    you might want to check any of the service wrappers that can launch win32 application, you can test launching JVM with arguments to your application, however they might not be as granular as wrapper explicitly written for java. – Johnydep Feb 13 '12 at 15:08

5 Answers5

5

Some time ago I used the tanuki project and we were very happy with it. I believe is one of the most popular ones.

There is also YAJSW that is based on tanuki (as I understand ) with a LGPL licence

mericano1
  • 2,844
  • 1
  • 15
  • 24
  • YAJSW is easy to install and also you do not need to alter your code. YAJSW is also provides a system tray, a custom console and a service configurator for Windows. – bhdrkn May 13 '14 at 10:36
3

I have used Tanuki's Java Service Wrapper with great success; it's easy to use.

There are community packages (free) and professional packages (license).

RustyTheBoyRobot
  • 5,670
  • 4
  • 33
  • 53
epoch
  • 15,647
  • 3
  • 39
  • 67
3

I'm now using WinRun4J - a really nice, lean tool that is easy to configure and handle and usable in commercial applications. Many thanks to assylias, whose comment pointed my in the right direction.

mort
  • 10,940
  • 14
  • 45
  • 92
2

AlwaysUp is a commercial alternative that supports Windows 7 and XP. This step-by-step tutorial shows you how to setup a java application as a service.

CoreTech
  • 2,187
  • 2
  • 16
  • 23
  • it might not be an ideal choice if you want to setup the whole process from within java itself, since AlwaysUP does not allow any command-line switches, or does it? – Johnydep Feb 13 '12 at 15:01
  • The "regular" AlwaysUp is GUI based but there are [command line tools for doing that sort of thing](http://www.coretechnologies.com/products/AlwaysUp/AlwaysUpCLT/) – CoreTech Feb 13 '12 at 16:01
2

I have recently used Java Service Wrapper from Tanukisoftware and it works perfectly on windows 7. Also the tool is pretty handy as it provides pretty extensive integration mechanism from simple jar execution to shutdown hook functionality as well.

For normal use, you can use their Community License which falls under GPL v2.0, however keep in mind if your intended use is on server, you might have to double check licensing options.

Also windows resource kit includes a tool called servany.exe which i successfully used on Windows Xp to start a jar file as a service by lanuching java.exe with arguments to my jar file, however since windows 7 this somehow does not work.

You might want to do a little research since i have read some forums about people still affirming that it works.

Johnydep
  • 5,301
  • 19
  • 52
  • 70