Reputation: 225
From time to time, Eclipse
(Indigo) complains that certain classes in my projects cannot be resolved to a type
. Even it shows the class in popup list, clicking import
(see image) does not add the import statement! Even if I add it manually, it doesn't recognize it (and underlines the import package).
Upvotes: 4
Views: 13303
Reputation: 1
Right click on the project -> Maven -> Update Project...
Check (Force Update of Snapshots/Releases)
Upvotes: 0
Reputation: 1343
This just happened to be in Eclipse Neon.2 (2016 release) on a non-Maven project. Refreshing / updating the project did not help, but I was able to fix this without recreating the project:
Upvotes: 0
Reputation: 105
For those not using Maven, simply deleting the project (and possibly re-cloning it) has reliably worked for me.
Upvotes: 0
Reputation: 180
Right click on your project name ->Maven ->Update Project
Upvotes: 9