Here you can find the source of executeProcess(final File workDir, final String... termArray)
public static Process executeProcess(final File workDir, final String... termArray) throws IOException, InterruptedException
//package com.java2s; /**//from ww w .java 2 s .c om * Copyright (C) 2013 Barchart, Inc. <http://www.barchart.com/> * * All rights reserved. Licensed under the OSI BSD License. * * http://www.opensource.org/licenses/bsd-license.php */ import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.List; public class Main { /***/ public static Process executeProcess(final File workDir, final String command) throws IOException, InterruptedException { final String[] termArray = command.split("\\s+"); return executeProcess(workDir, termArray); } /***/ public static Process executeProcess(final File workDir, final String... termArray) throws IOException, InterruptedException { final List<String> termList = Arrays.asList(termArray); final ProcessBuilder builder = new ProcessBuilder(termList); final Process process = builder.directory(workDir).start(); process.waitFor(); return process; } }