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.
So this is my workaround to this problem, inspired from Alnitak's suggestion: Run the command like this:
Process p = Runtime.getRuntime().exec(cmd + " < c:\\someTextFile.txt", null, cmdDir);
...
int errCode = p.waitFor();
...
the 'someTextFile.txt' can be programatically created into the temporary dir then deleted.