This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Retrieve password from console Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Retrieve password from console" Watch "Retrieve password from console" New topic

Retrieve password from console

Ketul Parikh

Joined: Jul 17, 2009
Posts: 14
Hi All,

I have a requirement to take password from console.
For jdk 6 there is a way to get it :


But, my problem is that, I have to do it using jdk 5, is there any equivalent way of doing it.

Peter Taucher
Ranch Hand

Joined: Nov 18, 2006
Posts: 174
That's not a simple task. You could mask the user input yourself (printing "\010*") or take use of os specific functions. Both ways have their weak points.


Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
jQuery in Action, 2nd edition
subject: Retrieve password from console
Similar Threads
How to reset login username and password in administration console??
HELP! Logging into WebLogic9.2
Get password from Console
WAS Security
username and passward for new server