Use the InputStream/OutputStream objects returned by the respective methods in the Process class returned by Runtime.exec to communicate with the process. And some further reading: ...