src/share/classes/java/lang/Runtime.java

Print this page




 527     }
 528 
 529 
 530     /**
 531      * Executes the specified command and arguments in a separate process with
 532      * the specified environment and working directory.
 533      *
 534      * <p>Given an array of strings <code>cmdarray</code>, representing the
 535      * tokens of a command line, and an array of strings <code>envp</code>,
 536      * representing "environment" variable settings, this method creates
 537      * a new process in which to execute the specified command.
 538      *
 539      * <p>This method checks that <code>cmdarray</code> is a valid operating
 540      * system command.  Which commands are valid is system-dependent,
 541      * but at the very least the command must be a non-empty list of
 542      * non-null strings.
 543      *
 544      * <p>If <tt>envp</tt> is <tt>null</tt>, the subprocess inherits the
 545      * environment settings of the current process.
 546      *





 547      * <p>{@link ProcessBuilder#start()} is now the preferred way to
 548      * start a process with a modified environment.
 549      *
 550      * <p>The working directory of the new subprocess is specified by <tt>dir</tt>.
 551      * If <tt>dir</tt> is <tt>null</tt>, the subprocess inherits the
 552      * current working directory of the current process.
 553      *
 554      * <p>If a security manager exists, its
 555      * {@link SecurityManager#checkExec checkExec}
 556      * method is invoked with the first component of the array
 557      * <code>cmdarray</code> as its argument. This may result in a
 558      * {@link SecurityException} being thrown.
 559      *
 560      * <p>Starting an operating system process is highly system-dependent.
 561      * Among the many things that can go wrong are:
 562      * <ul>
 563      * <li>The operating system program file was not found.
 564      * <li>Access to the program file was denied.
 565      * <li>The working directory does not exist.
 566      * </ul>




 527     }
 528 
 529 
 530     /**
 531      * Executes the specified command and arguments in a separate process with
 532      * the specified environment and working directory.
 533      *
 534      * <p>Given an array of strings <code>cmdarray</code>, representing the
 535      * tokens of a command line, and an array of strings <code>envp</code>,
 536      * representing "environment" variable settings, this method creates
 537      * a new process in which to execute the specified command.
 538      *
 539      * <p>This method checks that <code>cmdarray</code> is a valid operating
 540      * system command.  Which commands are valid is system-dependent,
 541      * but at the very least the command must be a non-empty list of
 542      * non-null strings.
 543      *
 544      * <p>If <tt>envp</tt> is <tt>null</tt>, the subprocess inherits the
 545      * environment settings of the current process.
 546      *
 547      * <p>A minimal set of system dependent environment variables may 
 548      * be required to start a process on some operating systems. 
 549      * As a result, the subprocess may inherit additional environment variable 
 550      * settings beyond those in the specified environment.
 551      *
 552      * <p>{@link ProcessBuilder#start()} is now the preferred way to
 553      * start a process with a modified environment.
 554      *
 555      * <p>The working directory of the new subprocess is specified by <tt>dir</tt>.
 556      * If <tt>dir</tt> is <tt>null</tt>, the subprocess inherits the
 557      * current working directory of the current process.
 558      *
 559      * <p>If a security manager exists, its
 560      * {@link SecurityManager#checkExec checkExec}
 561      * method is invoked with the first component of the array
 562      * <code>cmdarray</code> as its argument. This may result in a
 563      * {@link SecurityException} being thrown.
 564      *
 565      * <p>Starting an operating system process is highly system-dependent.
 566      * Among the many things that can go wrong are:
 567      * <ul>
 568      * <li>The operating system program file was not found.
 569      * <li>Access to the program file was denied.
 570      * <li>The working directory does not exist.
 571      * </ul>