The new process will invoke the command and arguments given by {@link #command()}, in a working directory as given by {@link #directory()}, with a process environment as given by {@link #environment()}.
This method checks that the command is a valid operating system command. Which commands are valid is system-dependent, but at the very least the command must be a non-empty list of non-null strings.
If there is a security manager, its {@link SecurityManager#checkExec checkExec}method is called with the first component of this object's command
array as its argument. This may result in a {@link SecurityException} being thrown.
Starting an operating system process is highly system-dependent. Among the many things that can go wrong are:
In such cases an exception will be thrown. The exact nature of the exception is system-dependent, but it will always be a subclass of {@link IOException}.
Subsequent modifications to this process builder will not affect the returned {@link Process}.
@return A new {@link Process} object for managing the subprocess @throws NullPointerException If an element of the command list is null @throws IndexOutOfBoundsException If the command is an empty list (has size0
)
@throws SecurityException If a security manager exists and its {@link SecurityManager#checkExec checkExec}method doesn't allow creation of the subprocess
@throws IOException If an I/O error occurs
@see Runtime#exec(String[],String[],java.io.File)
@see SecurityManager#checkExec(String)
|
|
|
|
|
|
|
|
|
|
|
|