ProcessBuilder gives a “No such file or directory” on Mac while Runtime().exec() works fine

后端 未结 1 1225
长情又很酷
长情又很酷 2020-12-05 22:36

I have an application, running on the Playframework, which needs to encode some video files. I used

Process pr = Runtime.getRuntime().exec(execCode)
         


        
相关标签:
1条回答
  • 2020-12-05 23:25

    You need to specify the arguments as separate Strings:

    new ProcessBuilder("cmd", "arg1", "arg2", ...);
    

    The constructor accepts String, varargs, and List<String>.

    See ProcessBuilder documentation.

    0 讨论(0)
提交回复
热议问题