Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse the import cannot be resolved after Java update

I have class that uses hibernate, I have included all required jars to classpath and class worked before Java updated itself. But now eclipse shows that it cannot resolve some hibernate imports. What could be solution to this?

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
like image 786
newbie Avatar asked Jan 23 '10 07:01

newbie


3 Answers

Delete .m2/repository/org/hibernate/*, then in eclipse: Maven/update Project. It will download the dependencies again. It worked for me!

like image 162
Duc Dat Nguyen Avatar answered Oct 06 '22 03:10

Duc Dat Nguyen


If you type (Ctrl + shift + t), or open the Type Explorer and type SessionFactory or Configuration does Eclipse find them? If not, then for sure you have some problems in the .jar files. Try to delete and replace them.

By the way are you using a Mac or PC?

like image 26
Omar Al Kababji Avatar answered Oct 06 '22 02:10

Omar Al Kababji


Did you try "Project > Clean ..."? What is the exact error message? After a Java update, you might need to update the path to the JDK: "Window > Preferences > Java > Installed JREs"

like image 36
sfussenegger Avatar answered Oct 06 '22 02:10

sfussenegger