Java Runtime.exec()

后端 未结 3 2050
情话喂你
情话喂你 2020-11-27 07:02

I can run this command from the command line without any problem (the validation script executes):

c:/Python27/python ../feedvalidator/feedvalidator/src/demo         


        
3条回答
  •  春和景丽
    2020-11-27 07:25

    You need to drain the output and error streams of the process, or else it will block when the executed program produces output.

    From the Process documentation:

    Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.

提交回复
热议问题