Hibernate - Environment


This chapter explains how to install Hibernate and other associated packages to prepare an environment for the Hibernate applications. We will work with MySQL database to experiment with Hibernate examples, so make sure you already have a setup for MySQL database. For more detail on MySQL, you can check our MySQL Tutorial.

Downloading Hibernate

It is assumed that you already have the latest version of Java installed on your system. Following are the simple steps to download and install Hibernate on your system −

Hibernate Directories

Installing Hibernate

Once you downloaded and unzipped the latest version of the Hibernate Installation file, you need to perform following two simple steps. Make sure you are setting your CLASSPATH variable properly otherwise you will face problem while compiling your application.

Hibernate Prerequisites

Following is the list of the packages/libraries required by Hibernate and you should install them before starting with Hibernate. To install these packages, you will have to copy library files from /lib into your CLASSPATH, and change your CLASSPATH variable accordingly.

Sr.No. Packages/Libraries
1

dom4j

XML parsing www.dom4j.org/

2

Xalan

XSLT Processor https://xml.apache.org/xalan-j/

3

Xerces

The Xerces Java Parser https://xml.apache.org/xerces-j/

4

cglib

Appropriate changes to Java classes at runtime http://cglib.sourceforge.net/

5

log4j

Logging Faremwork https://logging.apache.org/log4j

6

Commons

Logging, Email etc. https://jakarta.apache.org/commons

7

SLF4J

Logging Facade for Java https://www.slf4j.org