Runtime.getRuntime().exec()执行lin

2020-07-10  本文已影响0人  cherishpf

Linux下:

String[] command = { "/bin/sh", "-c", cmmd };

Process ps = Runtime.getRuntime().exec(command);

Windows下:

String[] command = { "cmd.exe", "/c", cmmd };

Process ps = Runtime.getRuntime().exec(command);

原文链接:https://www.xuebuyuan.com/1290921.html

上一篇 下一篇

猜你喜欢

热点阅读