Runtime: exec(String command) (2) : Runtime « java.lang « Java by API
- Java by API
- java.lang
- Runtime
Runtime: exec(String command) (2)
/*
* Output:
*/
public class MainClass {
public static void main(String args[]) {
Runtime r = Runtime.getRuntime();
Process p = null;
try {
p = r.exec("notepad");
} catch (Exception e) {
System.out.println("Error executing notepad.");
}
}
}
Related examples in the same category