Here you can find the source of executeProcess(final String[] cmds)
public static final void executeProcess(final String[] cmds)
//package com.java2s; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static final void executeProcess(final String[] cmds) { Thread processThread = new Thread(new Runnable() { @Override// w w w.j av a 2 s. c o m public void run() { try { // if ( logger.isDebugEnabled() ) // { // logger.debug("Executing command: " + getCommandStr(cmds)); // } // Process childProcess = Runtime.getRuntime().exec(cmds); String line; BufferedReader outbr = new BufferedReader(new InputStreamReader(childProcess.getInputStream())); BufferedReader errbr = new BufferedReader(new InputStreamReader(childProcess.getErrorStream())); while (((line = outbr.readLine()) != null) || ((line = errbr.readLine()) != null)) { // if ( logger.isDebugEnabled() ) // { // logger.debug(line); // } } } catch (Exception e) { // logger.warn("Error while launching the process: " + getCommandStr(cmds), e); } } }); processThread.start(); } }