简体   繁体   English

我如何将Windows进程作为Windows Server 2003服务运行?

[英]How would I run a java process as a Windows Server 2003 service?

I'm looking for the best way to run a java app as a Windows Server 2003 service. 我正在寻找将Java应用程序作为Windows Server 2003服务运行的最佳方法。 What are my options, and what's the basic general process for going about doing this? 我有哪些选择,以及实现这一目标的基本一般流程是什么? Thanks much. 非常感谢。

One thing you could try is the Tanuki Wrapper: 你可以尝试的一件事是Tanuki Wrapper:

http://wrapper.tanukisoftware.org/doc/english/download.jsp 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. 该软件基本上将Java可执行文件包装成可由服务控制台调用的内容。

One option would be to use procrun. 一种选择是使用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. 您从http://tomcat.apache.org获取procrun.exe(也是tomcat.exe),然后传递exe参数来安装该服务。 The available parameters are listed at http://commons.apache.org/daemon/procrun.html 可用参数列在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. 另一个选项是java服务包装器来自: http//wrapper.tanukisoftware.org/doc/english/download.jsp ,但我过去没有好运。

There's the JavaService.exe by OW2 consortium . OW2联盟JavaService.exe I have seen a software vendor use this to deploy their commercial Java product as a Windows Service. 我见过一个软件供应商使用它来将他们的商业Java产品部署为Windows服务。 It is very easy to install the Windows Service: a simple command issued to the JavaService.exe utility. 安装Windows服务非常简单:向JavaService.exe实用程序发出一个简单的命令。 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 JavaService.exe -install“我的服务”c:\\ j2sdk \\ jre \\ bin \\ server \\ jvm.dll -Djava.class.path = c:\\ app \\ classes.jar -start com.my.ExampleClass -err c:\\应用程序\\的stderr.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM