I have a batch file that runs on Windows which calls a Java class and this Java class does something and returns either 0 or -1. Here it is:
@echo off
java -cp wcs-all-1.3.jar;scala-library.jar;health-test-1.0-SNAPSHOT.jar com.test.healthtest.ServerHealthTest localhost 9999
set exitCode=%ERRORLEVEL%
if not %exitCode% 0 goto doFail
:doFail
echo %exitCode%
call ../stop
call ../start
When I run this however, I get the following message printed on the console. My Java program actually returns -1 which means that my batch file should actually call two other batch files, but I see the following as the last line:
0 was unexpected at this time.
Any ideas as to what is wrong?