1

I have created a Windows service that is supposed to start a certain Java process but something is wrong and the process does not start. Does this service generate any log that I can read in order to understand what's wrong?

I tried looking into Windows Event Viewer but it does not look like starting/stopping this service results in any events.

I created the service using this batch file:

@echo off
TITLE "Installing Service"

set "INSTALL_HOME=%~dp0"

REM export environment variables 
setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_25"
setx PATH "%PATH%;%JAVA_HOME%\bin"

instsrv.exe Node "C:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"
reg import "%INSTALL_HOME%\Node.reg"
echo "Install Complete"
pause

And the Node.reg looks like this:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Node\Parameters]
"Application"="C:\\temp\\start_node.bat"
"AppDirectory"="C:\\temp"
"AppParameters"="> C:\\temp\\logs\\srvany.log 2>C:\\temp\\logs\\srvany.error.log"

Please not that there are no principal problems with the way I install this service as it works fine on my other machines.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.