System.console() returns null

Gauls picture Gauls · Nov 17, 2010 · Viewed 85.6k times · Source

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.Console class. Problem is that System.console() returns null when an application is debugged in Eclipse. I am new to Java and Eclipse not sure is this the best way to achieve? I am right clicking on the source file and selecting "Debug As" > "Java Application". Is there any workaround?

Answer

swimmingfisher picture swimmingfisher · Dec 14, 2011

This is a bug #122429 of eclipse