Issue
I'm working on a library and I would like to have the class Node. Most of the times it works fine but sometimes it gives the error Node cannot be resolved to a type
on every place where I use a node.
The strange thing is that if I rename the class to DNode, for example, and rename every Node to DNode and then change everything back again to just Node, it's like the way it was before but the errors saying Node cannot be resolved to a type
are gone (until a certain time).
Compiling is also no problem btw, it seems to be an Eclipse bug or something.
I know there is this Node class, but I don't import it so I can't see why that would form a problem.
I hope someone can help.
Solution
I've seen similar behaviour in the past and know of two possible reasons:
- Your build path has somehow changed, leaving out your Node class, or the project providing it has compile errors, or similar. Given your description of the problem, this probably isn't relevant in your case.
- Some Eclipse screwup. For me, this was always solved by doing a clean build of the project (possibly also any dependent projects) at which point things resolved themselves. You can do this by going to the
Project
menu and selectingClean
. This isn't a proper solution, but strikes me as quicker than yourNode
->DNode
->Node
workaround.
Answered By - Jon Bright
Answer Checked By - Senaida (JavaFixing Volunteer)