14

I wanted to try my hands on C++ and wanted to use the same netbeans IDE since I have being using it for sometime for Java development. I downloaded the Cygwin tools and set up the IDE accordingly. When I try to run the application it says that the build was successful...,

"/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)

But the program will not run. It throws a Java Null pointer exception.

java.lang.NullPointerException


RUN FAILED (exit value -1, total time: 26ms)

Since there are no Java code in C++ programs this has to be an issue with the IDE. I saw this thread in the Netbeans forum http://forums.netbeans.org/topic52231.html

Here the user has changed the IDE version which I don't want to do.

Is there anyone out there who has come across this situation who can help me out. I'll be glad! Thanks in advance!!

LalakaJ
  • 531
  • 7
  • 16
  • 1
    _Try_ NetBeans 7.3, and see if it fixes the problem. – Matt Ball Apr 01 '13 at 03:55
  • Thanks @MattBall, I don't want to upgrade. I found the solution you have to add the Cygwin path (C:\cygwin\bin\) to the environment path variable then it works fine? Look at [link](https://netbeans.org/community/releases/72/cpp-setup-instructions.html#compilers) – LalakaJ Apr 01 '13 at 04:04

3 Answers3

27

I had the same problem under Linux Mint 18 Cinnamon with Netbeans 8.1 and I solved it by right-click the project name item -> Properties -> Run -> Console Type -> "Standard output"

After that the "Run" command worked perfect.

林果皞
  • 7,539
  • 3
  • 55
  • 70
Alex
  • 5,510
  • 8
  • 35
  • 54
  • This is the correct answer. (Same issue w new build of NetBeans 8.1 under Lubuntu.) Although I prefer External Terminal. The default of Internal Terminal appears to be a lose. – DragonLord Mar 20 '17 at 21:24
  • This solved the same problem in NetBeans 8.1, installed in Ubuntu 16.04 LTS. – Romeo Sierra Aug 14 '18 at 05:18
3

I found the solution you have to add the Cygwin path (C:\cygwin\bin) to the environment path variable then it works fine? Look at link https://netbeans.org/community/releases/72/cpp-setup-instructions.html#compilers

LalakaJ
  • 531
  • 7
  • 16
2

I encountered the same issue when I upgraded Ubuntu from 14.04 LTS to 16.04 LTS and upgraded NetBeans IDE from 8.0.2 to 8.1 via Synaptic. I guess my JVM installation was messed up. My solution was to uninstall NetBeans 8.1 with Synaptic and then download and install the same version 8.1 from https://netbeans.org/downloads/ (all-in installer). It fixed the issue.

Xevious
  • 21
  • 2