ProcessBuilder Demo : ProcessBuilder « Development Class « Java






ProcessBuilder Demo

     
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.Use ProcessBuilder.environment()
2.Use of ProcessBuilder that duplicates the functions of the DoRuntime example:
3.Exec Helper
4.Launches a process, redirecting the output of that sub-process to the output of this (the parent) process.
5.Process Watcher
6.Execute a command