Netbeans Having Problems With Imports

Hello, I’m the head programmer from team 3176. This year we gained a lot of interest in programming from other members so I decided to use my own laptop for my programming and let them experiment on our team laptop. It has been working out for the entire build season, but today one of them called me over with an interesting question. I came over to the computer and noticed nearly everything was underlined, assuming it was a misplaced bracket I looked through it attempting to fix it. When I went to look back at another program, we have been using, nearly everything on that was underlined as well. After some thinking I noticed that the imports seem to be the issue.

How it appears:
import edu.wpi.first.wpilibj (all works up to this point)

When typing after that the only thing to show up is templates, if I try to type something like IterativeRobot, it will be underlined with an error saying, “Cannot find symbol, import section does not correspond to the specified code style rules.”

Now you know what my problem is, here is what I’ve done to attempt to fix it:

I first decided to restart netbeans, after that failed I restarted the computer and when that failed I uninstalled the plugins and then reinstalled the plugins.
After that failed, I decided to uninstall netbeans and reinstall netbeans. Once again it failed, so I’m here typing this long thread in hope a fellow FIRST member will be able to help me.

I’ve given you all the information I have, the only thing I could think could be a problem is when uninstalling netbeans, it left over some files (however I told it to delete everything when prompted to save any of the files).

Thanks in advance for your help.

import edu.wpi.first.wpilibj.* instead.

That should fix your problem.

Are the wpilibj packages included as libraries in the project? If your teammates created a regular Java project (instead of an FRC project), the libraries wouldn’t be included. You should see them in the project browser (left sidebar) under libraries. Since your machine has been working, compare what they have to what you have.

after the wpilbj make sure there is a dot(.) and you should get a list of items to choose from.

Already tried that, guess I forgot to add that to my first post.

I have tried creating a completely new one with an FRC project, like I had said all of the programs on the computers are affected by whatever the problem is.

There is, and it still won’t pop up.

This seems to indicate to me that Netbeans is looking for the libraries in a location where they aren’t. When you install the FIRST Netbeans plugins, WPILibJ is installed somewhere on your system that Netbeans knows about (I’m not sure where this is on Windows, but on linux it’s in ~/sunspotfrcsdk/lib/WPILibJ). If the files were moved from this location, Netbeans would have no way of finding the libraries, and would complain. I’d reinstall the FRC plugins first; if that doesn’t work, I’d try to figure out where Netbeans is looking and where the libraries actually are, and make them match up. If the problem still persists after that, then it is probably an issue with either the libraries or Netbeans itself.

Although I may be mistaken; I’m not quite sure what it means by “import section does not correspond to the specified code style rules”. It might be indicating a messed-up environment setting instead of a messed-up library.

I like the idea of the above post. but if that does not work, have you tried opening one of the pre-made samples?

Yeah I already tried re loading the plugins, I suppose the next thing to do is figuring out where netbeans is looking for the libraries.

I’m not sure that would help since I’ve even tried creating a new project and importing them.

The next time I’ll be able to use the laptop would be monday, I’ll try and find where netbeans is looking for with the libraries then. I had attempted to do so before, but I was overwhelmed with other tasks that needed my attention.

Thank you everyone who has tried to help, I’ll let you know how it goes monday.

Seems I was unable to edit any of my prior posts.

Still not sure how it managed to get messed up, but I was indeed able to fix it tonight. I started by opening up a source of CANJagauar on another programming computer, then I opened WPILibJ in projects, when I went to delete it, it showed me it’s location (asking if I wanted to delete source files). From there I went on another computer and copied the WPILIBJ folder onto a thumb drive and simply replaced the faulty one on another computer.

Thanks everyone who tried to help, the problem has now been solved.