WanderingMathematician
WanderingMathematician

Reputation: 443

Netbeans code completion screwed up

Something has gotten horribly screwed up in my netbeans configuration, and I cannot figure out what it is or how to fix it. I'm running netbeans 8.0 c++ on debian 7.4. When I have this code:

#include <cstdlib>
#include <vector>

using namespace std;

int main(int argc, char** argv)
{
    vector<int> h;
    h.push_back(4); //THIS LINE
    return 0;
}

Netbeans underlines the line I have a comment on in red and says it's unable to resolve identifier push_back. When I just type h. the suggestions come up with a bunch of vector constructors, but no methods like push_back or erase. I can't understand why that is, it was working an hour ago and I haven't changed anything since. It broke when I opened one of my projects.

I've tried opening and closing the project, closing and opening netbeans, rebooting my computer, and reinstalling netbeans. Nothing worked.

Upvotes: 5

Views: 2183

Answers (3)

ame
ame

Reputation: 1

With Netbeans 8.2 JRE 1.8, I got problems on vector code completion on some member function. I modify etc/netbeans.conf (JAVAHOME=) I Install JRE 1.7.9 The problems is solve. (LINUX) Reparse project code assistance, and all is working !

Upvotes: 0

V. Fran&#231;ois
V. Fran&#231;ois

Reputation: 66

Solution found : OpenJDK 7 is buggy.

To solve this problem I installed Oracle JDK 1.7 in my home directory, and I removed three directories ~/.cache/netbeans, ~/.netbeans and ~/.nbi. I updated the netbeans_jdkhome variable in the file ~/netbeans-dev-201405050001/etc/netbeans.conf to the path of Oracle JDK 1.7.

Now the C++ Netbeans parser works perfectly, whatever the complexity of statements.


    Product Version: NetBeans IDE Dev (Build 201405050001)
    Java: 1.7.0_55; Java HotSpot(TM) Client VM 24.55-b03
    Runtime: Java(TM) SE Runtime Environment 1.7.0_55-b13
    System: Linux version 3.2.0-4-686-pae running on i386; UTF-8; fr_FR (nb)
    User directory: /home/admin/.netbeans/dev
    Cache directory: /home/admin/.cache/netbeans/dev

Upvotes: 3

V. Fran&#231;ois
V. Fran&#231;ois

Reputation: 66

Same problem for me (Netbeans 8.0 - Debian 7.4 - OpenJDK 7) , to fix this problem I installed NetBeans Development at this address

Upvotes: 2

Related Questions