Eclipse error ... cannot be resolved to a type
Also If you are using mavenised project then try to update your project by clicking Alt+F5. Or right click on the application and go to maven /update project.
It builds all your components and resolves if any import error is there.
Right click your project name.
Click
Properties
.Click
Java Build Path
.Click on
Add Class Folder
.Then choose your class.
Alternatively, Add Jars
should work although you claim that you attempted that.
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
To solve the error "...cannot be resolved to a type.." do the followings:
- Right click on the class and select "Build Path-->Exclude"
- Again right click on the class and select "Build Path-->Include"
It works for me.