Hibernate Installation/Setup on Eclipse IDE

I will show how to install Hibernate in this blog post and I will set up a small database application that can store events in my another post Sample Hibernate Application.Although you can use whatever database and IDE you feel comfortable using, I will use Oracle Database 10g Express Edition and Eclipse IDE. Also I assume that Java is already installed on your system.

You should download the latest production release of Hibernate from the Hibernate website at http://www.hibernate.org/ or http://sourceforge.net/projects/hibernate/files/hibernate3/ and unpack the archive after download.
Note: I have downloaded the latest production release, hibernate-distribution-3.6.6.Final-dist.zip. If there is a newer version when you’re reading this post, I advice you to download and use it.

Create a new Java Project and enter HibernateApplication as project name.

Create lib and src subdirectories in this project. (When you create a new Java Project in Eclipse IDE, src subdirectory will be created automatically.)

Copy JAR files which are listed below, from hibernate distribution that you have downloaded to the lib directory of the “HibernateApplication”project.

Under root directory of the hibernate distrubution:

Under lib/required directory of the hibernate distrubution:

Under lib/jpa directory of the hibernate distrubution:

Download slf4j-1.6.1.zip file from http://www.slf4j.org/download.html, unpack the archive and copy the slf4j-simple-1.6.1.jar file to lib directory of the “HibernateApplication” project.

Additionally, you will need the database driver JAR that Hibernate uses to connect to your database. I use Oracle Express Edition(Oracle XE) and it’s database driver jar is here on Windows:
Copy this ojdbc14.jar to the lib directory of the “HibernateApplication” project.

Note: You should replace this database driver JAR with a different database driver JAR if you have another database management system already installed.You only need to obtain a JDBC driver for it. For example, you must download MySQL Connector/J (official JDBC driver for MySQL) from http://www.mysql.com/downloads/connector/j/ if your database is MySQL and copy the database driver jar to the HibernateApplication\lib directory.

After these steps “HibernateApplication” project will look like this:

Now I will create a User library on Eclipse IDE. Then, I will add all JAR files in the HibernateApplication\lib directory to this User library and add this User library to the project build path.

Click Window–>Preferences on the top menu bar of Eclipse.

Click Java–>Build Path–>User Libraries and click New button then enter “Hibernate”
as the User library name.
User Library

Select “Hibernate” User library that we just created and click Add JARS… button.
Hibernate User Library

Select all JAR files in the lib folder of the “HibernateApplication” project and click Open button to add all JAR files to “Hibernate” User library.

Now “Hibernate” User library is ready and we can add this User library to “HibernateApplication” project build path.

Right click to “HibernateApplication” project and click Build Path–>Add Libraries

Then, select “User Library” and click Next button.

Finally, select “Hibernate” User library and click Finish button.

After adding “Hibernate” User library to “HibernateApplication” project, it will look like this:

Congratulations, you have installed Hibernate on Eclipse IDE and you may want to read my another blog post Sample Hibernate Application


About kaanmutlu

Software Developer - Computer Engineer from Istanbul, Turkey
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

12 Responses to Hibernate Installation/Setup on Eclipse IDE

  1. Romil says:

    Good work and nicely explained..

  2. Causemann says:

    Well explained and very helpful

  3. Maulik Patel says:

    Very Detailed ..
    Gud job

  4. Ajinkya says:

    Thank You Very Very Much 🙂

  5. Rahul Wagh says:

    Nice article on the Hibernate setup.

    For more detail regarding setup and creating basic program please follow


  6. sharan says:

    thank you

  7. gaddamgnaneshwar says:


  8. propiere says:

    hi i am currently following your step to install Hibernate5.2.0 final in eclipse Mars.2 Release (4.5.2). but in the lib\required folder i cannot find these jar files: jta1.1.0.jar, Hibernate3.0.jar, Commons-Collections3.1.jar
    need your help please, i have such these 3 missing jar files in other folders of Hibernate5.2.0 final
    thanks again

  9. VM says:

    thank you for a Very Detailed explanation it’s helpful.

  10. Akkamai says:

    Perfect job! Thanks a lot!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s