title: How to Send a Password to Process in Java
body: <p>I am launching a process from java to run a command for me. This process runs for a little while, then needs a password to continue. Now I know that I can write to the in stream of the proces, but I am not quite sure how to detect when I need to write to it.</p>
  
  <p>Possible solutions:<br>
  Is there a way that I can detect that the process is blocking?<br>
  Can I just write to the standard in immediately after executing the command and when the process hits a point when it needs it, it can just read from it?</p>
  
  <p>Any other ideas?</p>