ProcessBuilder pb = new ProcessBuilder(currentlyProcessing).redirectErrorStream(true);
Process p = pb.start();
p.waitFor();
Hi above is my code. currentlyProcess==/blah/hoho.sh
and hoho.sh just sleeps for 10 seconds
The issue I am having is how do we determine if the process is still running? I am assuming that another thread has been spawned to run the process hence p.waitFor() would pretty much return 0 the moment it executes the command.
I would like to open processA and once processA have completed, run processB and once processB have completed run processC etc etc
Thank you in advance