Java Runtime.getRuntime(): getting output from executing a command line program

前端 未结 12 1580
清歌不尽
清歌不尽 2020-11-22 00:18

I\'m using the runtime to run command prompt commands from my Java program. However, I\'m not aware of how I can get the output the command returns.

Here is my code:

12条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 00:35

    Besides using ProcessBuilder as suggested Senthil, be sure to read and implement all the recommendations of When Runtime.exec() won't.

提交回复
热议问题