title: Java Program not taking the Piped input
body: <p>I have to work with a Java program which takes 2 user inputs like this:</p>
  
  <pre><code>Enter username:
  Enter password:
  </code></pre>
  
  <p>So I thought of sending it like </p>
  
  <pre><code>echo -e "myusername\npassword" | java javaprogram 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>java javaprogram &lt; input.txt
  </code></pre>
  
  <p>Both didn't work.</p>
  
  <p>When I execute this command it's showing the error like this:</p>
  
  <pre><code>Enter userID: Enter password: Exception in thread "main" java.io.IOException: Unable to mask input in console. at..
  </code></pre>
  
  <p>I don't know the source code of this jar file. </p>
  
  <p>What can be the reason for this ?</p>