Go to Post I've always suspected that one could find glimpses of wisdom, setting priorities, and responsibility - and ways to balance them, in the contents of a coffee cup. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2012, 13:27
Cjdowney's Avatar
Cjdowney Cjdowney is offline
Registered User
AKA: Cody Downey
FRC #3176 (Purple Precision)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Brownsburg, IN
Posts: 13
Cjdowney is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2012, 18:50
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: Netbeans Having Problems With Imports

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

That should fix your problem.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2012, 20:25
FourPenguins's Avatar
FourPenguins FourPenguins is offline
Back in the Game
AKA: Ed Venator
FRC #2399
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Mount Olive, NJ
Posts: 261
FourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud ofFourPenguins has much to be proud of
Re: Netbeans Having Problems With Imports

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.
__________________
MORT 11
-2005 New Jersey Regional Chairman's Award Winner
-2006 Palmetto Regional Winner
-2007 New York Regional Delphi Driving Tomorrow's Technology Award
-2008 New Jersey Regional Finalist, Chesapeake Regional Winner, Championship Event Overall Top Seed
HB 2399
-2009 Buckeye Regional Delphi Driving Tomorrow's Technology Award, Pittsburgh Regional GM Industrial Design Award
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2012, 20:28
Herbblood's Avatar
Herbblood Herbblood is offline
Knowledgeable
AKA: Ally
FRC #3044 (OxBE4)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2008
Location: Ballston Spa
Posts: 247
Herbblood is an unknown quantity at this point
Re: Netbeans Having Problems With Imports

after the wpilbj make sure there is a dot(.) and you should get a list of items to choose from.
__________________
Off to WPI!
Go OxBE4
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2012, 23:54
Cjdowney's Avatar
Cjdowney Cjdowney is offline
Registered User
AKA: Cody Downey
FRC #3176 (Purple Precision)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Brownsburg, IN
Posts: 13
Cjdowney is an unknown quantity at this point
Re: Netbeans Having Problems With Imports

Quote:
Originally Posted by neal View Post
import edu.wpi.first.wpilibj.* instead.

That should fix your problem.
Already tried that, guess I forgot to add that to my first post.


Quote:
Originally Posted by FourPenguins View Post
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.
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.


Quote:
Originally Posted by Herbblood View Post
after the wpilbj make sure there is a dot(.) and you should get a list of items to choose from.
There is, and it still won't pop up.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2012, 00:32
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Netbeans Having Problems With Imports

Quote:
Originally Posted by Cjdowney View Post
all of the programs on the computers are affected by whatever the problem is.
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-02-2012, 00:38
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Re: Netbeans Having Problems With Imports

I like the idea of the above post. but if that does not work, have you tried opening one of the pre-made samples?
__________________
"you can build a perfect machine out of imperfect parts" -Urza
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2012, 02:58
Cjdowney's Avatar
Cjdowney Cjdowney is offline
Registered User
AKA: Cody Downey
FRC #3176 (Purple Precision)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Brownsburg, IN
Posts: 13
Cjdowney is an unknown quantity at this point
Re: Netbeans Having Problems With Imports

Quote:
Originally Posted by Ginto8 View Post
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.
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.

Quote:
Originally Posted by techkid86 View Post
I like the idea of the above post. but if that does not work, have you tried opening one of the pre-made samples?
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 06-02-2012, 18:27
Cjdowney's Avatar
Cjdowney Cjdowney is offline
Registered User
AKA: Cody Downey
FRC #3176 (Purple Precision)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Brownsburg, IN
Posts: 13
Cjdowney is an unknown quantity at this point
Re: Netbeans Having Problems With Imports

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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi