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).
右键单击您的项目名称 -> Maven -> 更新项目
对于那些不使用 Maven 的人来说,简单地删除项目(并可能重新克隆它)对我来说可靠地工作。
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:
Right click on the project -> Maven -> Update Project...
Check (Force Update of Snapshots/Releases)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.