控制本机进程

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();
    }
}

原文地址:https://www.cnblogs.com/vonk/p/3906985.html