You need to separate the command from its arguments when calling exec, eg .exec(new String[] { "ps", "aux" }) (not exec("ps aux")). When you need to pass arguments, you need to invoke the String[] version - the first element of the String[] is the command, the rest are the arguments.
You need to send the contents of the output stream of the first command to the input stream of the second command. I used Apache commons IOUtils to do this with ease.
You must close the input stream of the grep call, otherwise it will hang waiting for the end of input.
With these changes in place, this code does what you want:
import org.apache.commons.io.IOUtils;
public static void main(String[] args) throws Exception
{
Process p1 = Runtime.getRuntime().exec(new String[] { "ps", "aux" });
InputStream input = p1.getInputStream();
Process p2 = Runtime.getRuntime().exec(new String[] { "grep", "java" });
OutputStream output = p2.getOutputStream();
IOUtils.copy(input, output);
output.close(); // signals grep to finish
List result = IOUtils.readLines(p2.getInputStream());
System.out.println(result);
}