public Process exec (String[] cmdarray, String[] envp) throws IOException

Executes the specified command and arguments in a separate process with the specified environment.

This is a convenience method. An invocation of the form exec(cmdarray, envp) behaves in exactly the same way as the invocation exec(cmdarray, envp, null).

Parameters:
cmdarray    array containing the command to call and its arguments.
envp    array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

Returns:  A new Process object for managing the subprocess

Exceptions:
SecurityException     If a security manager exists and its checkExec method doesn't allow creation of the subprocess
IOException     If an I/O error occurs
NullPointerException     If cmdarray is null, or one of the elements of cmdarray is null, or one of the elements of envp is null
IndexOutOfBoundsException     If cmdarray is an empty array (has length 0)

See also:
ProcessBuilder