System.console()返回null [英] System.console() returns null

查看:437
本文介绍了System.console()返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 readLine BufferedReader 从用户获取输入/新密码,但想要屏蔽密码所以我试图使用 java.io.Console 类。问题是当在Eclipse中调试应用程序时, System.console()返回 null 。我刚刚接触Java和Eclipse不知道这是最好的方式实现吗?我正确点击源文件,选择调试为>Java应用程序。是否有解决方法?

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?

推荐答案

这是一个错误#122429 of eclipse

This is a bug #122429 of eclipse

这篇关于System.console()返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆