When using Runtime.exec() or ProcessBuilder, one has to understand that environment variable interpolation has to be done using a shell. This is one of the traps dealt with in the 4 sections of
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html. You would do well to read this and implement the recommendations.
As a minimum, your code needs to be modified to
but
you should also handle the Process stderr as well as the stdout.
P.S. I have fixed your code for reading from the Process stdout. One should always take note of the number of bytes actually read.
[ November 13, 2008: Message edited by: James Sabre ]