title: How to supply password to a java process
body: <p>I'm using a bash script to start a java program/process. The bash script prompts for username and password and should supply these to the java process. I don't want to supply these as parameters for the java program so they can be seen as clear text using the shell "ps" command. So I don't want any of the following:</p>
  
  <pre><code> - java MyClass &lt;clearTextPassword&gt;
   - java -Dpass=&lt;clearTextPassword&gt;
  </code></pre>
  
  <p>Are there any recommended ways to supply the password to the java process from a shell script?</p>
  
  <p>Thanks in advance for any suggestions.</p>
  
  <p>Best regards Trym</p>