this is what I want to do:
I need to start two jar Files from out of a java file and i want to call a method from the firstly started jar file, when i read a specific status from the second jar file. I figured out how to read the outsputstream from that jar files. (I also know, that its not the jar file who's printing out, but the classes inside the jar file. I just fomulated the question in this way to clearly explain that I use a java file in which I start two jar files)
long l = System.currentTimeMillis();
Process theProcess1 = Runtime.getRuntime().exec("java -jar \"C:/test.jar\"");
inStream = new BufferedReader(new InputStreamReader( theProcess1.getInputStream() ));
...
I can now read the jar file's output.
On a special keyword I want the firstly started jar to run a certain method (non static).
e.g.:
if(theProcess2 output a certain statuscode)
{
start a certain Method from executed jar file "in" theProcess1
}
I think it could be possible by using the theProcess1 output, but I don't know how to read this stream in the jar File. (The jar file doesn't know that it was started via the java file.
Any Ideas?