String command = String.format(“fuser -k -n tcp %d”, port);
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec(command);
使用Java,根据端口号,关闭Linux进程。
最新推荐文章于 2023-09-01 15:46:00 发布
String command = String.format(“fuser -k -n tcp %d”, port);
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec(command);