I want to start a process that asks for a password. The password should be provided automatically. I tried:
Process process = processBuilder.start();
Thread.sleep(10000);
OutputStream os = process.getOutputStream();
PrintWriter writer = new PrintWriter(os);
writer.write(new String(password) + "\n");
But the password is apparently not written to the process. The process instead waits forever until it is killed.
How can I answer password prompts from within Java?