Changed the java interface to return both output and error streams.