Home >Java >javaTutorial >Why Does System.console() Return Null When Debugging in Eclipse?
System.console() Returns Null in Eclipse Debug Mode
When using the readLine method of BufferedReader to read input or a new password from a user, masking the password with the java.io.Console class is preferred. However, encountering a null return from System.console() while debugging in Eclipse can be frustrating.
Unfortunately, this issue is attributed to a bug (#122429) in Eclipse itself. The workaround involves disabling console logging during debugging:
This modification allows System.console() to function correctly even when debugging in Eclipse.
The above is the detailed content of Why Does System.console() Return Null When Debugging in Eclipse?. For more information, please follow other related articles on the PHP Chinese website!