1

I am working with one cmd like executable and source code of that is not available.

Executable is having multiple command sequence to be entered before it exit. Each command takes random time from 1 sec to 1 min.

I tried with Java's Process builder and runtime but I am getting output only after program completely exits from execution. Also, I am not able to insert any command to that executable via BufferedWriter. So my question is how to get output of executable while it is still running

Quenstions referred: Executing an EXE from Java and getting input and output from EXE

java runtime.getruntime() getting output from executing a command line program etc.

S S
  • 920
  • 1
  • 17
  • 34
  • 1
    That is probably because the `exe` doesn't write data to the output stream line by line. You'll have to read data from the process as it is available instead of reading it line by line. You can do that using an `InputStream` instead of a `BufferedReader`. – Titus Jul 04 '17 at 16:35

0 Answers0