views:

362

answers:

3

I'm looking for the best way to run a java app as a Windows Server 2003 service. What are my options, and what's the basic general process for going about doing this? Thanks much.

+5  A: 

One thing you could try is the Tanuki Wrapper:

http://wrapper.tanukisoftware.org/doc/english/download.jsp

This software basically wraps up the Java executable into something that can be invoked by the service console.

Andy White
I think that the license is now a little bit more restrictive.Yet Another Java Service Wrapper, http://yajsw.sourceforge.net/, is a good alternative, really free-to-use and supports 64-bit environment.
RealHowTo
+1  A: 

One option would be to use procrun. The only downside to this method is documentation is kind of slim.

The basic idea is simple. You grab the procrun.exe (which is also the tomcat.exe) available from http://tomcat.apache.org and then pass the exe parameters to install the service. The available parameters are listed at http://commons.apache.org/daemon/procrun.html

Another option is java service wrapper from: http://wrapper.tanukisoftware.org/doc/english/download.jsp, but I haven't had very good luck with it in the past.

Patrick
+1  A: 

There's the JavaService.exe by OW2 consortium. I have seen a software vendor use this to deploy their commercial Java product as a Windows Service. It is very easy to install the Windows Service: a simple command issued to the JavaService.exe utility. Below is the sample command they provide on their web site:

JavaService.exe -install "My Service" c:\j2sdk\jre\bin\server\jvm.dll -Djava.class.path=c:\app\classes.jar -start com.my.ExampleClass -err c:\app\stderr.txt

pythonquick