pass multiple parameters to ProcessBuilder with a space

后端 未结 3 1404
挽巷
挽巷 2020-12-01 17:33

I would like to pass multiple parameters to a processBuilder and the parameters to be separated by a space.

Here is the command,

String[] command_ary         


        
3条回答
  •  借酒劲吻你
    2020-12-01 17:51

    You don't need to include spaces. The ProcessBuilder will deal with that for you. Just pass in your arguments one by one, without space:

    ProcessBuilder pb = new ProcessBuilder(
                             dir + "library/crc",
                             "-s",
                             fileName,
                             addressRanges);
    

提交回复
热议问题