// To workaround the race condition issue with child processes
// inheriting unintended handles during process launch that can
// lead to hangs on reading output and error streams, we
// serialize process creation. More info available at:
// http://support.microsoft.com/kb/315939
proc = Runtime.getRuntime().exec(cmd.toStrings(), envVals);
}
//consume stderr
StreamOutputWriter errorGobbler = new
StreamOutputWriter(proc.getErrorStream(), "ERROR", errStream);