executor.setWatchdog(watchDog);
executor.setStreamHandler(new PumpStreamHandler());
int result = executor.execute(cmdLine, env);
if (executor.isFailure(result))
{
if (watchDog.killedProcess())
{
throw new RuntimeException("Reached timeout while running: " + cmdLine);
}
throw new RuntimeException("Process failed with return code [" + result + "]: " + cmdLine);
}