public class ProcessRuntime
public static void main(String args) throws IOException, InterruptedException
String process = "C:/Program Files/PostgreSQL/9.2/bin/psql.exe -U postgres -V postgres";
if (true) System.out.println(process);
// Hold control over Runtime Enviroment
Runtime run = Runtime.getRuntime();
The single String exec() you're using right now is a trap and its existence is a mistake, as you now so painfully realize. Now you can do a mental exercise however - this is the moment where you can start to accept that even code that just happens to work under certain conditions can still be wrong. Please do not go down the path of "but it worked in version X! It must be a bug in Java!" like so many others.