发布网友 发布时间:2024-10-12 12:19
共1个回答
热心网友 时间:2024-10-12 18:15
public Process exec(String[] cmdarray) throws IOException Executes the specified command and arguments in a separate process. The command specified by the tokens in cmdarray is executed as a command in a separate process. This has exactly the same effect as exec(cmdarray, null). If there is a security manager, its checkExec method is called with the first component of the array cmdarray as its argument. This may result in a security exception. Parameters: cmdarray - array containing the command to call and its arguments. 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 NullPointerException - if cmdarray is null IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).