在Netbeans 7.2中运行c++程序时出现java.lang.NullPointer异常
java.lang.NullPointer Exception when running C++ Programs in Netbeans 7.2
我想尝试一下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空指针异常。
java.lang.NullPointerException
RUN FAILED (exit value -1, total time: 26ms)
由于c++程序中没有Java代码,这必然是IDE的一个问题。我在Netbeans论坛上看到了这个帖子http://forums.netbeans.org/topic52231.html
这里用户更改了IDE版本,而我不想这样做。
有没有遇到过这种情况的人可以帮助我?我很高兴!提前感谢!!
我在Linux Mint 18 Cinnamon with Netbeans 8.1下遇到了同样的问题,我通过右键单击项目名称item -> Properties -> Run -> Console Type -> "Standard output"
之后的"Run"命令工作完美。
我找到了解决方案,您必须将Cygwin路径(C: Cygwin bin)添加到环境路径变量中,然后它可以正常工作?查看链接https://netbeans.org/community/releases/72/cpp-setup-instructions.html#compilers
当我将Ubuntu从14.04 LTS升级到16.04 LTS并通过Synaptic将NetBeans IDE从8.0.2升级到8.1时,我遇到了同样的问题。我猜我的JVM安装搞砸了。我的解决方案是用Synaptic卸载NetBeans 8.1,然后从https://netbeans.org/downloads/(all-in installer)下载并安装相同的8.1版本。
- java.lang.IndexOutOfBoundsException with JNA
- Android Studio 3.1.2 - 无法运行C++子例程"No implementation found for Java.lang.String..."
- java.lang.UnsatisfiedLinkError: Abc.greetings()V
- java.lang.Field 等效于 c++ 中
- 为什么日食总是发生错误"An internal error occurred during: "通知选择侦听器". java.lang.StackOverflowError"
- java.lang.UnsatisfiedLinkError:未找到实现
- JNI GetMethodID 调用,带有挂起的异常 java.lang.ClassNotFoundException
- java.lang.UnsatisfiedLinkError: dlopen failed: 无法加载"libPrivateSsl.so"所需的库"libcrypto.so.1.0.0";
- 单元测试环境中的"java.lang.UnsatisfiedLinkError: *.so: Can't find dependent libraries"
- JNI 代码返回字符串,但得到错误 java.lang.UnsatisfiedLinkError: com.packag
- 如何在没有System32的情况下解决"java.lang.UnsatisfiedLinkError:找不到依
- JNA从DLL调用C++对象-java.lang.IollegalArgumentException:Structure
- 线程中的异常 "main" java.lang.UnsatisfiedLinkError: no JNTIest in java.library.path
- jni java.lang.unsatisfiedlinkerror,无法链接方法
- 从WordCount Hadoop示例调用Helloworld Jni函数,给出错误Java.lang.unsatisf
- 在hadoop 2.7.4的自定义排序类中调用C函数,给出Java.lang.unsatisfiedlinkerror
- 在运行时获得Java.lang.unsatisfiedlinkerror
- AndroidRuntime: java.lang.UnsatisfiedLinkError: Native metho
- 线程"main" java.lang.UnsatisfiedLinkError: Native.initiate(I)V 从 Java 运行本机 dll 时
- JNI : 线程"AWT-EventQueue-0" java.lang.UnsatisfiedLinkError 中的异常