I am trying to install a simple java application as a windows service using javaservice.exe.
Below is my install command:
@"D:\Test\scripts\Windows\service\bin\Test Service.exe" -install "Test Service"
"D:\Test\jre\bin\client\jvm.dll" -jar "-Djava.class.path=test.jar" -start "com.test.TestServerCLI" -method "main" -params -eSTART -dmyDB -mmem -uSA -i9001 -out "D:\Test\log\Test Service_service.log" -current "D:\Test\bin" -manual
The TestServerCLI class file is under D:\Test\bin\com\test and jre is installed at D:\Test.
Whenever I run the service from Windows Services console I get a dialog box saying -
The Test Service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
The windows event log says -
Could not find the service class.
Event ID: 4096
I am running JRE 1.7.0_02 on Windows7 32-bit machine. The Javaservice version is 2.0.10.0.
Can someone help please?
I got it worked. The test.jar was not presentt in the specified classpath. I added the jar to my classpath and now it works.