This content has been marked as final. Show 5 replies
Take a look at the Console class, it has readPassword()
I am trying it with the Console class, but everytime that I try to do "System.console()", it returns null
System.console() returns null for me when I try to run the program in my IDE. Try to run it from the command line.
I need a solution that would able to hide password during user input (interactive) an to be able to read from stdin as well.
Can anybody give me a clue?
Moderator advice: Please don't post in threads that are long dead and don't hijack another poster's thread. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
Moderator action: Locking this thread.
Moreover, your question is answered in this thread. Didn't you at least read it before resurrecting it?