Process process = Runtime.getRuntime().exec("command");
Process process = Runtime.getRuntime().exec("command"); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while ((line = reader.readLine()) != null) { System.out.println(line); }
Process process = Runtime.getRuntime().exec("command"); process.destroy();This example starts a new process and then terminates it. Java Process is part of the java.lang package.