【发布时间】:2013-04-01 03:52:15
【问题描述】:
我想尝试使用 C++ 并想使用相同的 netbeans IDE,因为我已经将它用于 Java 开发有一段时间了。我下载了 Cygwin 工具并相应地设置了 IDE。 当我尝试运行应用程序时,它说构建成功...,
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cppapplication_1.exe
make[2]: Entering directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
make[2]: `dist/Debug/Cygwin-Windows/cppapplication_1.exe' is up to date.
make[2]: Leaving directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
make[1]: Leaving directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
BUILD SUCCESSFUL (total time: 450ms)
但程序不会运行。它会引发 Java Null 指针异常。
java.lang.NullPointerException
RUN FAILED (exit value -1, total time: 26ms)
由于 C++ 程序中没有 Java 代码,这一定是 IDE 的问题。我在 Netbeans 论坛上看到了这个帖子 http://forums.netbeans.org/topic52231.html
这里用户更改了我不想做的IDE版本。
有没有遇到过这种情况的人可以帮助我。我会很高兴的! 提前致谢!!
【问题讨论】:
-
尝试 NetBeans 7.3,看看它是否能解决问题。
-
谢谢@MattBall,我不想升级。我找到了解决方案,您必须将 Cygwin 路径 (C:\cygwin\bin) 添加到环境路径变量中,然后它可以正常工作吗?看link
标签: c++ netbeans nullpointerexception netbeans-7.2