Java Runtime.exec的使用

Linux

执行普通语句

Process proc =Runtime.getRuntime().exec("./exefile");
Process proc =Runtime.getRuntime().exec("/path/exefile");

执行系统命令

String [] cmd={"/bin/sh","-c",“ln -s exe1 exe2”};
Process proc =Runtime.getRuntime().exec(cmd);

猜你喜欢

转载自blog.csdn.net/a860MHz/article/details/86555989