如何在Java中执行带参数的命令?
我试过了
Process p = Runtime.getRuntime().exec(new String[]{"php","/var/www/script.php -m 2"});
这不管用。
String[] options = new String[]{"option1", "option2"};
Runtime.getRuntime().exec("command", options);
这不能很好地工作,因为没有指定m
参数。
https://stackoverflow.com/questions/7134486
复制相似问题