2013-02-12 89 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 
相關問題