I hit this eclipse bug, where System.console()
is not available for Java application launches. I have a small Java app that also requires a password to be entered that is only started from within the IDE. Is there any other way to safely read a password (meaning not displaying it on the console) from the console with only using JDK classes?
EDIT:
I know of System.in
, but that is displaying the inputed characters in the console and is therefore not safe.
EDIT2:
I also want to note that one can create a batch file under windows or a small bash script under linux/unix in the project. By openening this file in eclipse with the system default editor, it will be started in a new console window where System.console()
is available. This way you can start the application from within eclipse. but the project has to be built first, so that the binaries exist.