title: Java execute command line program
body: <p>I have a little problem with executing a command line tool. I want to execute UnRAR.exe from WinRAR. I do it like this:</p>
  
  <pre><code>Process process = runtime.exec("\"" + unrarPath + "\"" + " x -kb -vp " + "\"" + fileName + "\"", null, f.getParentFile());
  </code></pre>
  
  <p>My problem is that the compressed file is password protected. If I execute the command in my console I'm asked for a password. If I let Java execute it the program just ends and never waits for a user input (the password).</p>
  
  <p>I tried to write to the process outputstream but that didn't work. Is there anything I need to know about the behavior of command line programs executed in "different" environments?</p>
  
  <p><strong>EDIT:</strong> Maybe I wasn't clear enough. My question is: <em>Is it possible to interact with a command line program with Java?</em></p>