Setup Hibernate Environment

In this tutorial you will learn how you can setup Hibernate Development Environment for developing and testing the Hibernate based application.

Setup Hibernate Environment

Setup Hibernate Environment - Learn how to setup Hibernate Development Environment

Here in this section you will learn how to download and configure the Hibernate library files for developing the applications. The latest version of Hibernate comes with the all extra libraries necessary for developing the application.

Since we are using the MySQL database for testing the application we will also have to download the JDBC driver for MySQL. If you are using other database you should download the JDBC driver for you database from the official website of your database server.

Downloading the latest version of Hibernate

The latest version of Hibernate can be downloaded from it official website at http://hibernate.org/orm/downloads/. At the time of writing of the tutorial the final version of the Hibernate was Hibernate 4.2.8.Final.

Visit the website at http://hibernate.org/orm/downloads/ and you will find the links to download the software. Here is the screen shot of the same:

Download Hibernate 4.2.8

We have downloaded the file hibernate-release-4.2.8.Final.zip. It includes the libraries necessary to run the Hibernate based applications.

Installing Hibernate

Copy the downloaded file (hibernate-release-4.2.8.Final.zip) into a directory and then unzip it. Here the screen shot of the content of the file:

Hiberante Directory structure

Here you will find documentation, lib and project directories. Documentation directory contains the documentation and tutorials. The lib directory contains the library files and project directory contains many example projects.

Here is the content of lib directory:

Hiberante Directory structure

The lib directory contains the required folder which contains the required library of Hibernate. It contains other libraries also.

Here is the screen shot of lib/required folder:

Hiberante Directory structure

Documentation directory contains following sub-directories:

Hiberante Directory structure

Installing Hibernate is very easy process, you just have to unzip and then copy the library files from its lib directory. If you are using Eclipse, you have to copy the files into lib directory of your project. After copy the file in your project's lib directory, add the lib files in the class build path.

For copying the file into build path:

  • Right click on the project
  • Select "Java Build Path"
  • Then on the right side select "Libraries" and then click on the "Add JARs" and then select the jar files from your project.

This will make the jar files available in your project. In the next section we will learn about the Hibernate Configuration files used in the project.

Check more Hibernate 4.2 tutorials.