Port of schuchert.wikispaces.com


JPA_Tutorial_1_Eclipse_Project_Setup

JPA_Tutorial_1_Eclipse_Project_Setup

Next we need to start eclipse and create a workspace.

Create Initial Project

User Library

We are going to define a user library, which is just a collection of jar files with a name. Once we create this, we can add it to our classpath with one command. This also makes setting up new projects in the same workspace a snap. We can also export workspace settings and import them into a new workspace.

Now we need to add several jars to this list. For each of the following jars, do the following:

Here is a list of all the jar files you’ll need to add (note the path’s listed assume you extracted your jar files to C:/libs):

* C:/libs/hibernate-distribution-3.3.1.GA/lib/required/antlr-2.7.6.jar
* C:/libs/hibernate-distribution-3.3.1.GA/lib/required/commons-collections-3.1.jar
* C:/libs/hibernate-distribution-3.3.1.GA/lib/required/dom4j-1.6.1.jar
* C:/libs/hibernate-distribution-3.3.1.GA/lib/required/javassist-3.4.GA.jar
* C:/libs/hibernate-distribution-3.3.1.GA/hibernate3.jar
* C:/openejb-3.1.1/lib/javaee-api-5.0-2.jar
* C:/openejb-3.1.1/lib/log4j-1.2.12.jar
* C:/hibernate-entitymanager-3.4.0.GA/hibernate-entitymanager.jar
* C:/hsqldb-1.9.0-beta3/hsqldb/lib/hsqldb.jar
* C:/hibernate-annotations-3.4.0.GA/hibernate-annotations.jar
* C:/hibernate-annotations-3.4.0.GA/lib/hibernate-commons-annotations.jar
* C:/slf4j-1.5.8/slf4j-simple-1.5.8.jar
* C:/slf4j-1.5.8/slf4j-api-1.5.8.jar

Create Java Project

Next we need to create a Java project. We’ll keep the source separate from the bin directory:

Create folders and packages

Add Required Libraries

We now need to add two libraries. One will be the user-defined library we created above. The second will be JUnit 4.x.


Comments

" Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.