摘要: 當用下面敘述時會錯誤String command = new String{cd,path};
Process child = Runtime.getRuntime().exec(command, null);複製代碼可改用String cmd = { /bin/sh, -c, cd /var; ls -l };
Process p = Runtime.getR ...
當用下面敘述時會錯誤
String[] command = new String[]{"cd",path};
Process child = Runtime.getRuntime().exec(command, null);