bug (?) in ProcessBuilder.redirectErrorStream(true);
I was trying to run a process using the ProcessBuilder and ran into a problem:
when running the command with ProcessBuilder and redirecting the errors to output stream (with redirectErrorStream(true) method) we expect all the error messages to be in the ex.getMessage(), as the implementation in runProcess collects all the error messages and throws exception with all these errors in its message.
Specifically doesn't work: the command I'm trying to run is starting a service on my machine (Windows XP).
When the service is already started, and I'm running the command again: The result is a failure, but the error message is 'null' (printed in the message).
BUT if running it with Runtime.exec() and doing the same operation as ProcessBuilder does to collect the errors- the error appears as should be.
Is there anyone familiar with this???
thanks in advance,