且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

执行Linux命令在Java中

更新时间:2023-11-11 21:42:40

首先杀-9 pidnumber

为什么你需要的bash的变量? java的时候给你字符串存储变量?

Why would you need the bash variables? when java gives you strings to store variables?

第三,为什么不尝试 System.Runtime.getRuntime()。EXEC()

Thirdly why not try System.Runtime.getRuntime().exec() ?

另外你有权杀任务?试图须藤杀死-9 PID

Also do you have permissions to kill the task? tried sudo kill -9 pid?