I have a Java program that requires our API's MiddleWare to be started first in order for it to work. The MiddleWare is contained in a Java Jar file.
Normally I have everything working if I open two separate command prompts and start the jar file first then run the java program second.
I'm packing up the new program for our clients now and I would like to find a way to automatically start the MiddleWare prior to starting the application. I tried something like this,
@echo off
set APP_HOME=C:\Temp\Hammer
rem Set APP_HOME to the place where you installed Hammer.
if "%~1"=="" (
echo You must provide a Python script to run.
pause
) else (
java.exe -jar C:\GMSEC_API\bin\bolt.jar
java.exe -cp "%APP_HOME%\lib\jython.jar;%APP_HOME%\lib\Hammer.jar;%APP_HOME%\lib\gmsecapi.jar;%APP_HOME%\examples\Python;%APP_HOME%\jython2.5.3\Lib;%CLASSPATH%" bridenstine.hammer.main.Main %*
)
But because the first java.exe command starts the MiddleWare first and it runs on a loop until terminated the second java.exe command doesn't get run until I ctr^c
the first command.
So how could I start both commands in a synchronous fashion using one CMD file?