Java exec does not enable piping commands- there are 2 work arounds I know
Take the InputStream from the firstProcess and write it to a file@
InputStream in = process.getInputStream()
stick it throuh a Buffered Reader into a BufferedWriter into the file;
The alternative and cheating method:
write something that takes a String[] of processes
make the first process set up the exec
then for every other element write the processes to the StdIn
OutputStream out = process.getOutputStream();
This means the Shell is up and running properly and other commands put to the command line are processed by the OS.
I can give some more details later if you need
Tom