If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Note that from your java program's point of view STDIN of myProgram.exe is something you want to write to and hence an OutputStream, while STDOUT and STDERR are streams you want to read from and hence InputStreams.

If you need not set environment variables or the working directory, there are also abbreviated versions of Runtime.exec(). There are also the methods Process.exitValue() and Process.waitFor().
Consider to explicitely kill the process - via Process.destroy() - if you are not sure that it does properly terminate since the subprocess will execute asynchronously when there are no more references to the Process object (or maybe you want that).
Finally, Java 1.5 offers the more convenient and flexible ProcessBuilder to create Processes.