java.lang.Runtime
exec
public Process exec(String command)
throws IOException
Executes the specified string command in a separate process.
The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call: new StringTokenizer(command)
with no further modifications of the character categories. This method has exactly the same effect as exec(command, null). Parameters:
command - a specified system command.
Returns:
a Process object for managing the subprocess.
Throws:
SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
IOException - if an I/O error occurs
See Also:
exec(java.lang.String, java.lang.String[]), SecurityManager.checkExec(java.lang.String)
exec
public Process exec(String command)
throws IOException
Executes the specified string command in a separate process.
The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call: new StringTokenizer(command)
with no further modifications of the character categories. This method has exactly the same effect as exec(command, null). Parameters:
command - a specified system command.
Returns:
a Process object for managing the subprocess.
Throws:
SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
IOException - if an I/O error occurs
See Also:
exec(java.lang.String, java.lang.String[]), SecurityManager.checkExec(java.lang.String)
abstract int exitValue()
Returns the exit value for the subprocess.
InputStreamReader isr=new InputStreamReader(prc.getInputStream());