Here's a simple sample that does more or less what you want:
Runtime r = Runtime.getRuntime();
Process p = r.exec ( "/bin/hostname" );
try {
p.waitFor();
} catch (InterruptedException e){
// do something
}
InputStream in = p.getInputStream();
...
You can also send stuff to the process via stdout, check exit codes, and so on.