java.lang.Runtime.getRuntime().exec(cmd)命令中参数不能用空格怎么办?
迷茫
迷茫 2017-04-18 10:54:01
0
2
982

项目中无法执行c程序,猜测是exec()函数的问题

String cmd= exe_path + " " +video + " " +host + ":" + port;
Process process = runtime.exec(cmd);

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

répondre à tous(2)
伊谢尔伦
String[] cmd = new String[]{exe_path, video, host + ":" + port}
小葫芦
String[] cmd = {"/data/data/app_name/exename", "3" "ip:port"};
java.lang.ProcessBuilder builder = new java.lang.ProcessBuilder(cmd);
java.lang.Process process = builder.start();
int exitcode = process.waitFor();
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal