2013-02-12 110 views
0

我试图使用WinRun4J作为Windows服务运行Java应用程序。如何使用WinRun4J作为Windows服务运行Java应用程序

我在应用程序目录复制WinRun4J64c.exe,放在旁边的下列service.ini文件:

service.class=org.boris.winrun4j.MainService 
service.id=MyAPP 
service.name=MyAPP 
service.description=some description 

classpath.1=./lib/* 
classpath.2=WinRun4J.jar 

[MainService] 
class=play.core.server.NettyServer 

但如果我启动服务:WinRun4J64c.exe --WinRun4J:RegisterService我得到:

Service control dispatcher error: 1063 

什么是错的?

回答

2

我没有得到它的工作,所以我的解决方法是使用Apache Commons Deamon。我使用以下参数执行了附带的prunsrv.exe:

prunsrv.exe install "MeineAnwendung" \ 
--Install="C:/pfad/zu/prunsrv.exe" \ 
--JvmOptions=-Dpidfile.path=NUL 
--Jvm=auto \ 
--Startup=auto \ 
--StartMode=jvm \ 
--Classpath="c:/irgendwo/anwendung/lib/*;" \ 
--StartClass=play.core.server.NettyServer 
相关问题