ProcessBuilder: start() : ProcessBuilder « java.lang « Java by API






ProcessBuilder: start()

/*
 * Output: 
 */

public class MainClass {
  public static void main(String args[]) {

    try {
      ProcessBuilder proc =  new ProcessBuilder("notepad.exe testfile");
      proc.start();
    } catch (Exception e) {
      System.out.println("Error executing notepad.");
    }
  }
}

           
       








Related examples in the same category

1.ProcessBuilder: command(String... command)
2.ProcessBuilder: directory(File directory)
3.ProcessBuilder: environment()
4.ProcessBuilder: redirectErrorStream(boolean redirectErrorStream)