Running ToyAppForJPA outside Netbeans or Eclipse

Moderator: admin

Post Reply
Posts: 6
Joined: Thu Oct 09, 2014 7:14 am

Running ToyAppForJPA outside Netbeans or Eclipse

Post by jackstuard »


If someone would like to run ToyAppForJPA without an IDE here's how I did:

Edit pom.xml and add this dependency under dependencies:

Code: Select all

Open src\main\resources\META-INF\persistence.xml and change:

Code: Select all

<property name="hibernate.connection.url" value="jdbc:derby://localhost:1527/toyjpadb"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.ClientDriver"/>

Code: Select all

<property name="hibernate.connection.url" value="jdbc:derby:toyjpadb;create=true"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
Now run the follow command in ToyAppForJPA folder:

Code: Select all

mvn clean install dependency:copy-dependencies
and then to start the App enter the target folder (cd target) and execute:

Code: Select all

java -cp ToyAppForOCPJPA.jar;.\dependency\* guiclient.JPATest
You can create a bat to make easier to start the app.

Site Admin
Posts: 10024
Joined: Fri Sep 10, 2010 9:26 pm

Re: Running ToyAppForJPA outside Netbeans or Eclipse

Post by admin »

Great! Thank you for posting it here. I'm sure it will be helpful for other readers.

If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest