The java command you select outputs the output to standard output. Your streaming should be uploaded to the input stream by your caller. This does not happen in your program.
You have to read the input stream ( is in your code) in a separate stream, because this is how streams work with streams. Note that you must start the read stream before calling execute() .
See also Capturing large volumes of output from Apache Commons-Exec
According to your other question, streaming output with commons-exec? you expect big data, so you should use streams with channels and you cannot use a simpler approach to using ByteArrayInputStream as output. The answer you give yourself suffers from the same problem as your code here.
source share