One neat way is to run the command with runtime.exec and connect readers to the stdout and errout of the command. You can also connect a writer to the stdin of the program and interact with prompts and responses and such. You kinda need to get into some threading tricks to make it all work, so it's not quite a trivial task. Let us know if you'd like samples.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Processes can output to 2 distinct streams, stdout and stderr. While you see these two as one in a command box, they are still distinct. When reading one, you will not see the results of the other.
There are ways to redirect them, so that they both go to the same stream: - in Java, use System.setOut(System.err) or System.setErr(System.out). - if that is not possible, you can use OS redirection. After your command you add a 2>&1 to redirect the error stream to the output stream and >&2 for the other way around. E.g, "someCommand -paramater value <any other input to the command here> 2>&1". There cannot be any spaces around the >.