JDK-4960438 : (process) Need IO redirection API for subprocesses
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.3.0,1.4.0,1.4.2_02,5.0,6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_8,windows_2000
  • CPU: generic,x86,sparc
  • Submitted: 2003-11-26
  • Updated: 2017-05-16
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7 b25Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
The output (stdout and stderr) of a process started via
Runtime.exec() or ProcessBuilder.start() is always directed to a pipe
that can only be read by the creating Java process.

We need to be able to re-create the functionality that comes standard
with most command processors
command > filename  # redirect subprocess output into a file
command             # subprocess output goes to same location as parent output

WORK AROUND On a particular platform, one can usually work around this using a shell script or similar mechanism new ProcessBuilder("/bin/sh", "-c", "command > file 2>&1").start(); ###@###.### 2003-11-26

EVALUATION Intuitively, the stdout and stderr of a child process should simply be settable attributes of ProcessBuilder(). But you can't pass a stream, because non-Java children couldn't understand that; you have to pass a lower-level object like a FileDescriptor. ###@###.### 2003-11-26