// start output threads
standardOutWriter.setDaemon(true);
standardErrorWriter.setDaemon(true);
standardOutWriter.start();
standardErrorWriter.start();
int returnValue = process.waitFor();
// make sure other two threads are done
standardOutWriter.join();