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也不行。最后是通过
Project-Clean (eclipse->Project menu->Clean..)解决掉的。上面是一篇文章,列举了一系列的方法。
http://blog.csdn.net/lazy_p/article/details/7452846
分享到:
相关推荐
在进行Android应用开发时,尤其是使用Eclipse作为集成开发环境(IDE)时,开发者可能会遇到一个常见的错误:“The import android cannot be resolved”。这个错误通常发生在尝试导入或打开一个已存在的Android项目...
在编程过程中,我们时常会遇到各种编译错误,其中一种常见的问题是"The import com.loopj cannot be resolved"。这个错误信息表明你的项目无法找到`com.loopj`包,这通常是由于缺少必要的库文件导致的。`com.loopj`...
然而,有时在开发过程中,我们可能会遇到"The import javax.crypto cannot be resolved"这样的错误提示,这意味着编译器无法找到这个包或者其依赖的库。这通常是由于JDK的默认配置中未包含某些安全相关的扩展,如...
在开发Spring框架相关的Java应用时,可能会遇到"The type org.springframework.dao.support.DaoSupport cannot be resolved"的错误提示。这个错误通常意味着编译环境无法找到`DaoSupport`类,这是Spring DAO模块中的...
Java Eclipse 出现 "xxx cannot be resolved to a type" 错误解决方法 Java Eclipse 是一个功能强大且广泛使用的集成开发环境(IDE),但是在使用过程中可能会出现各种错误信息,例如 "xxx cannot be resolved to a...
rsslib4j-0.2.jar jar包,解决java报错找不到资源包问题 The import org.gnu cannot be resolved。 报错 import org.gnu.stealthp.rsslib.*; RSSChannel、RSSException、RSSHandler、RSSItem、RSSParser
org.apache.http的相关类,android高版本SDK需要用到,解决'The import org.apache.http.HttpEntity cannot be resolved'>等问题: > ★org.apache....
4. 多条"The import javax.servlet cannot be resolved": 指出IDE找不到`javax.servlet`包,该包包含了Servlet API的核心类和接口。 这些错误的原因通常是因为Eclipse没有配置正确的Servlet运行环境,即没有关联到...
测试类报错Test cannot be resolved to a type-附件资源
当你在项目中遇到"The import org.apache.commons.lang3 cannot be resolved"的错误时,通常是因为缺少了这个库的引用,导致你的代码无法找到所需的类。 `org.apache.commons.lang3`是该库的主要包名,其中包含了...
org.apache.poi JAR包,解决个人的 import org.apache.commons.beanutils.PropertyUtilsBean; import org.apache.commons.lang.StringUtils;..."The import org.apache.poi cannot be resolved"的问题
jar包,官方版本,自测可用
在Java的Swing库中,`JTable`是用于创建表格视图的重要组件。它允许开发者展示和操作二维数据集,通常与一个`TableModel`一起使用来实现数据绑定。在这个`JTable`示例源码中,我们将会深入探讨如何使用`TableModel`...
validation-api-2.0.0.Final.jar 主要用于支持Maven项目,缺失可引起以下异常The type javax.validation.Payload cannot be resolved. It is indirectly referenced from required .class files
Lombok 是一个 Java 库,它通过注解处理器自动为类生成常见的 getter、setter、构造器和其他辅助方法,从而减少样板代码。在 Java 项目中使用 Lombok 可以显著提高开发效率,但同时也会遇到一些问题。...
解决经常遇到的The import org.apache.commons.codec cannot be resolved问题,只需导入文件中的commons-codec-1.11.jar就可以,如和导入包就不赘述了。
Eclipse Jee Oxygen 安装 activiti-5.18 1.在jee-oxygen\eclipse\configuration\org.eclipse.update 中找到platform.xml,在里面添加 url="features/org.activiti.designer.feature_5.18.0.201508100929/"> ...
【云计算概述】 云计算是一种通过互联网提供按需计算服务的模型,包括硬件资源、软件应用和服务。它使得用户能够随时随地访问并使用存储空间、处理能力、应用程序和服务,无需直接管理和维护底层基础设施。...
在Spring框架中,依赖包管理是一项关键任务,它涉及到如何正确地引入和组织各种库以确保应用程序能够正常运行。在本文中,我们将深入探讨Spring框架所依赖的主要包及其功能。 首先,Spring自身依赖于Apache Ant作为...