I was using readLine of BufferedReader to get input/new password from user, but wanted to mask the password so I am trying to use java.io.Con
According to the API:
"If the virtual machine is started from an interactive command line without redirecting the standard input and output streams then its console will exist and will typically be connected to the keyboard and display from which the virtual machine was launched. If the virtual machine is started automatically, for example by a background job scheduler, then it will typically not have a console."