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

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

问题描述

我正在使用 readLine BufferedReader 从用户处获取输入/新密码,但希望掩盖密码所以我试图使用 java.io.Console 类。问题是当在Eclipse中调试应用程序时, System.console()返回 null 。我是新来的Java和Eclipse不知道这是最好的方法吗?我右键单击源文件并选择Debug As>Java Application。有没有解决方法?

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?

推荐答案

这是一个

This is a bug #122429 of eclipse

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

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