When executing some command(let\'s say \'x\') from cmd line, I get the following message: \"....Press any key to continue . . .\". So it waits for user input to unblock.
I wrote an answer to command line execution at this stackoverflow question.
Yours is a bit more tricky since you probably need to reply.
In your case it might me necessary to give the input stream gobbler something like a reply channel:
StreamGobbler outputGobbler = new StreamGobbler(
proc.getInputStream(), "OUTPUT",
proc.getOutputStream());
and make it match a pattern and reply on the given input stream.
while ((line = br.readLine()) != null) {
System.out.println(type + ">" + line);
if (line.contains(PRESS_KEY_CONTINUE) {
ostream.write("y".getBytes("US-ASCII"));
System.out.println("< y");
}
}
Hope this helps.