Java: wait for exec process till it exits

前端 未结 3 1172
傲寒
傲寒 2020-12-31 13:19

I am running a java program in Windows that collects log from Windows events. A .csv file is created on which certain operations are to be performed.

The commands a

3条回答
  •  猫巷女王i
    2020-12-31 13:44

    You need to use waitFor() instead of wait(). That way your thread will block until the executed command finishes.

提交回复
热议问题