public class RunTimeDemo02 {
public static void main(String[] args) {
Runtime runtime = Runtime.getRuntime();
Process process = null;
try {
process = runtime.exec("notepad.exe");
} catch (Exception e) {
e.printStackTrace();
}
try {
Thread.sleep(5000);
} catch (Exception e) {
e.printStackTrace();
}
process.destroy();
}
}