File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieve password from console

 
Ketul Parikh
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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

System.console().readPassword()

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
Posts: 174
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

-> http://stackoverflow.com/questions/1108937/how-to-mask-a-password-in-java-5
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic