execute an external command in java

前端 未结 2 725
天涯浪人
天涯浪人 2020-12-20 02:48

Is there a way to execute a command in java that doesn\'t suffer from the startup overhead (slowness) of using ProcessBuilder?

More detail: I am using im4java which

2条回答
  •  梦毁少年i
    2020-12-20 03:07

    Runtime.getRuntime().exec(...)  
    

    can be used to run an external command. You can turn your List into a command array or a string to pass to exec().

提交回复
热议问题