Java: popen()-like function?
Process process = Runtime.getRuntime().exec("your command");
Then you can read and write the data using the Process
streams.
JDK5 introduced ProcessBuilder for more control over the process generation.
Process process = new ProcessBuilder(command).start()
Be aware of the fact, that internally forkAndExec is invoked, and fork 'makes a copy of the entire parents address space', so that even a little command can lead to OutOfMemoryErrors, when the parent process has big amount of memory space acquired.
see here