well as the script will be outputting the prompt to the screen, it will be necessary to capture the processes inputstream
InputStream stdout = process.getInputStream ();
I would also recommend using
ProcessBuilder builder = new ProcessBuilder("/home/user/test.sh");
builder.redirectErrorStream(true);
Process process = builder.start();