NetBeans 终端 window 是灰色的,不接受字符

NetBeans terminal window is gray and won't accept characters

我是 运行 64 位 Windows 7 PC 上的 NetBeans 8.0.2。我试图跟随 Geertjan Wielenga's instructions 起床和 运行 Scala in NetBeans 8.x.

第一条指令开始,"In the Terminal window, ..."所以我选择了Window > IDE Tools > Terminal。该选项卡的内容区域不是可用的终端 window,而是完全灰色的。我注意到 window 中似乎有文字在变灰之前闪烁,因此我多次单击 "Create New Local Terminal Tab" 按钮,直到我能够阅读消失的文字:

Unable to start pty process

搜索此短语会得到 C/C++ 项目和 "Run" 命令的结果,但我没有执行 C/C++ 项目。如何让终端 window 进入可以与之交互的状态?

NetBeans 终端仿真器需要 Cygwin。重要的是,NetBeans 的位数必须与 Cygwin 的位数匹配。如果您使用的是 64 位版本的 NetBeans,那么您必须使用 64 位版本的 Cygwin;同样是 32 位和 32 位。

这个comment by Andrew Krazny on NetBeans bug 234221说:

A bitness of jdk/netbeans is important. Possible options are:

  1. 32-bit NB and only 32-bit cygwin is installed
  2. 32-bit NB and only 64-bit cygwin is installed
  3. 32-bit NB and both 32/64-bit cygwin are installed
  4. 64-bit NB and only 32-cygwin is installed
  5. 64-bit NB and only 64-cygwin is installed
  6. 64-bit NB and both 32/64-bit cygwin are installed

Cases 1) and 5) are 'ideal' - in this case everything should work and it is highly recommended that bitness of NB/cygwin match. This means that if one tries to use cygwin64 (s)he should install 64-bit java and run 64-bit version of NetBeans (netbeans64.exe).

Case 2) is almost nonfunctional. It requires cygwin64/bin to be in %Path%; compilation will work, but run is possible in 'External Terminal' only.

Case 3) NB will detect 32-bit cygwin and will use it by default. IF user tries to add cygwin64 as a toolchain and compile his code in 64-mode, run in 'Output Window' will not work. 32-bit toolchain is OK in this case

Case 4) is almost nonfunctional. It requires cygwin/bin to be in %Path%; compilation will work, but run is possible in 'External Terminal' only.

Case 6) 64-bit compilation/run will work, 32-bit run will fail.

就我而言,我使用的是 32 位 Cygwin 和 64 位 NetBeans。我安装了 64 位 Cygwin,添加了一个 CYGWIN_HOME 环境变量,并在我的路径末尾添加了 %CYGWIN_HOME%\bin,现在我有一个正常运行的终端 window.

¹我讨厌这样做,因为有些命令名称重叠