read output from java process