I have 2 jar files at different locations. I need to run both these jar files from a single command prompt window.
I referred to many SO links and google links and created this batch job.
START SET JPOS_DIR=D:\Installable\JPOS\Iso8583jPOSJavaAgent-0.0.11
cd /D %JPOS_DIR%
"C:\Program Files\Java\jdk1.7.0_75\bin\java" -cp Iso8583jPOSJavaAgent-0.0.11.jar com.hp.sv.iso8583.jpos.ISOForwarderMain
START SET JPOS_DIR=D:\Installable\JPOS_Instance-2\Iso8583jPOSJavaAgent-0.0.11
cd /D %JPOS_DIR%
start "C:\Program Files\Java\jdk1.7.0_75\bin\java" -cp Iso8583jPOSJavaAgent-0.0.11.jar com.hp.sv.iso8583.jpos.ISOForwarderMain
But i am getting the below error message
"Windows cannot find -cp. make sure you type the name correctly and try again."
Can someone tell me what I am missing here ?
The syntax for the start command is as follows,
so in the command,
it considers "C:\Program Files\Java\jdk1.7.0_75\bin\java" as title and -cp as the command to run, thats why you get the error.
Try using the following command,
Alternatively, you can run without any quotes where we don't need to pass the title,
set Java in PATH before executing this command. Hope this helps.