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

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

问题描述

我使用 BufferedReaderreadLine 从用户那里获取输入/新密码,但想屏蔽密码,所以我尝试使用 java.io.Console 类.问题是 System.console() 在 Eclipse 中调试应用程序时返回 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?

推荐答案

这是一个 bug #122429 eclipse

This is a bug #122429 of eclipse

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

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