AmoebaMan
AmoebaMan

Reputation: 21

Eclipse imports inexplicably not resolved

I'm having a rather mysterious error:

All of my imports have been redlined with the message "the import cannot be resolved". However, the types referenced by those same imports are also redlined, and the auto fix suggests adding those exact imports.

http://i.imgur.com/GRJoP6P.png

http://i.imgur.com/uBmrTHm.png

The imports in question are from another project in my workspace, and that project is definitely in this project's workspace.

Does anybody know what the hell is going on here?

EDIT: I got the issue to go away by removing the project from the build path, copying it, deleting it, then pasting it back into the workspace and re-adding it to the build path. I'd still like to know if anybody knows what the heck happened though.

Upvotes: 2

Views: 86

Answers (2)

Makoton
Makoton

Reputation: 453

Sometimes it problems occurs when you are using maven and maven delete all .classes, one solution is clean your project

In eclipse menu bar: Project > clean

Upvotes: 0

Brian
Brian

Reputation: 7326

This happens sometimes when your buildpath loses its reference to your JRE. You can fix this by re-adding the JRE System Library to your buildpath. It is an interesting bug in Eclipse that I'm not sure why it happens.

The other option is to start new project and copy everything over, but this is tedious and annoying as it looks you have already discovered.

Upvotes: 1

Related Questions