How to start a java application as windows 2000 service?
843798Jan 9 2004 — edited Jan 9 2004Hi all,
I'm trying to start / stop a java application as a windows 2000 service. But nothing appens (I can see the screen that rapidly display the java help prompt and then disappear)
I've a working directory i.e C:\MyDir and it contains instsrv.exe, srvany.exe and my application jar MyApp.jar
I'm using instsrv.exe to register a java application as a service ( C:\MyDir\instsrv MyApp C:\MyDir\srvany.exe )
I've added a key in registry by running regedit
The key is under the tree HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyApp
the key value is Parameters
in the key I've added a string value "Application" with the value "C:\j2sdk1.4.2_01\bin\java.exe"
and a string value "AppParameters" with the value "-classpath C:\MyDir\MyApp.jar main" where main is the name of the main class application.
This seems to run correctly with Windows NT 4.0
But doesn't work with Windows 2000.
Can anyone help me?? pls.
Thanks.
Max