Import *** cannot be resolved

1.


Right click on project - >BuildPath - >Configure BuildPath - >Libraries tab - >

Double click on JRE SYSTEM LIBRARY - >Then select alternate JRE

http://stackoverflow.com/questions/16918959/import-cannot-be-resolved

2.

I found the problem. It was the hibernate3.jar. I don't know why it was not well extracted from the .zip, maybe corrupt. A good way to check if jars are corrupt or not is navigating through their tree structure in "Project Explorer" in Eclipse: if you can't expand a jar node probably it's corrupt. I've seen that having corrupt packages it's frequent when you drag and drop them to the "Project Explorer". Maybe it's better to move and copy them in the OS environment! Thankyou all.

http://stackoverflow.com/questions/4322893/eclipse-error-the-import-xxx-cannot-be-resolved

3.

Eclipse “Import cannot be resolved” error

by Sherif


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 recognising 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

Hope at least ONE of those tips help!

转至:http://blog.sherifmansour.com/?p=207

今天遇到的问题,包明明存在却突然报找不到包的错误,重启eclipse无法解决,Refresh也不行。最后是通过[size=x-large][b]Project-Clean[/b][/size] (eclipse->Project menu->Clean..)解决掉的。上面是一篇文章,列举了一系列的方法。


http://blog.csdn.net/lazy_p/article/details/7452846

你可能感兴趣的:(Eclipse)