I'm trying to work with Hibernate in Eclipse. I'm creating a new simple project and I've downloaded a collegue project too, via CVS. Both don't work, while on my collegue's Eclipse do. The problem is that, for each import of an Hibernate class, Eclipse says:

The import org.hibernate cannot be resolved

But all Hibernate jars are in the build path, that is:

antlr-2.7.6.jar
cglib-2.2.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
hibernate3.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
javassist-3.12.0.GA.jar
jta-1.1.jar
slf4j-api-1.6.1.jar

推荐答案

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.

Java相关问答推荐

SQlite for Android无法使用json_group_array/json_object

ittext pdf延迟签名,签名无效

为什么一个java函数会返回一个作为参数传递给它的对象?

弹簧靴和龙目岛

在Java Stream上调用collect方法出现意外结果

是否保证在事务性块的末尾标记违反约束?

无法在WebSocket onMessage中捕获错误

Spark上下文在向Spark提交数据集时具有内容,但Spark在实际构建它时发现它为空

如何在ApachePOI中将图像添加到工作表的页眉?

声明MessageChannel Bean的首选方式

try 在Android Studio中的infoWindow中使用EditText(Java)

X=x*0.90;产生有损转换误差.X*=0.90;不是.为什么?

Android Studio模拟器没有互联网

深度优先搜索实现:算法只向右搜索

除0错误/抱歉我的句子是PT

获取月份';s在java中非UTC时区的开始时间和结束时间

在JSON上获取反斜杠

如何在 WebSphere Application Server 内的托管线程上运行 BatchEE 作业(job)?

更新不可变的深层嵌套字段

在数组列表中找到对象后,未从数组中删除对象