[To] http://energykey.javaeye.com/blog/296380
The import *** cannot be resolved
For a long time, the problem was generally caused by copying a project or copy a copy from somewhere else.Source code,
Select project --> clean to solve the problem. Purpose of this option: Delete the. Class file in the project and re-compile the project, similar to rebuild in jbuild
If the problem persists, try to delete the import and manually import [Alt +/] one by one /]
Http://blog.sherifmansour.com /? P = 207
I'm amazed at how many shortcuts or different ways there are of doing things in eclipse.
Recently I kept hitting an issue of eclipse not recognizing my imports (even though they were there). I was always getting the message:
Import classname cannot be resolved
.
Where classname was my imported class. i'm using the myeclipse workbench 5.5.1 on Eclipse 3.2. here are a few tips on how you can fix this (some worked for me, some didn't ):
- 'Clean' your Eclipse project: Go to project> clean in eclipse [This seems to work for me]
- Refresh your project folder (right click on your project> refresh)
- Re-build your project
- Clean your builds (if using ant or Maven-clean your builds)
- Recreate your project in eclipse
- 'Switch 'Workspace-then switch back (eg change to debug, then switch back to Java)
- 'Switch 'Workspace-then switch back (eg change to debug, then switch back to Java)
- Remove and re-add your JRE:
1. Right click on your project> Properties
2. Click on the libraries Tab
3. Click on the JRE
4. Click remove, then OK
5. Repeat 1-3 again, but add the JRE again