Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node cannot be resolved to a type

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.

like image 620
clankill3r Avatar asked Mar 14 '26 13:03

clankill3r


1 Answers

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 selecting Clean. This isn't a proper solution, but strikes me as quicker than your Node->DNode->Node workaround.
like image 172
Jon Bright Avatar answered Mar 17 '26 02:03

Jon Bright



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!