cygwin中的Java控制台 [英] java console in cygwin
问题描述
在cygwin上, java.lang.System.console()
返回null,导致调用 readPassword
等的程序崩溃.
On cygwin java.lang.System.console()
returns null, crashing programs that call readPassword
and such.
除了更改程序以从 stdin
读取之外,是否还有其他一些技巧可以使它起作用?
Is there some trick to make it work, short of changing the program to read from stdin
?
推荐答案
我认为这回答得很好:
https://github.com/mintty/mintty/issues/56
https://github.com/mintty/mintty/issues/244
该问题对于使用伪终端的所有Cygwin终端都很常见(pty)设备,Cygwin使用Windows管道实现.这根本原因是Windows没有界面将允许模拟控制台.有关详细信息,请参见第56期.
The problem is common to all Cygwin terminals using pseudo terminal (pty) devices, which Cygwin implements using Windows pipes. The underlying reason is that Windows doesn't have an interface that would allow to emulate a console. See issue 56 for details.
这篇关于cygwin中的Java控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!