Home

 

Setting up the build path for OpenJPA

Because this class runs outside of the server, we have to add the required JPA and server libraries to the build path.

Right-click the RAD75JPATest project and select Properties.

In the Properties dialog, select Java Build Path (on the left) and the Source tab. Change the output folder from RAD75JPATest/bin to RAD75JPATest/src (Figure | 2-8). Without this change, the persistence.xml file that we create will not be found.

Figure 12-8 Java Build Path of Java project: Source

Select the Libraries page (Figure | 2-9):

Figure 12-9 Java Build Path of Java project: Libraries

Click Add Variable.
In the New variable Classpath Entry dialog, select ECLIPSE_HOME, and click Extend (Figure | 2-10).

Figure 12-10 Extending a variable

In the Variable Extension dialog, expand runtimes Æ base_v7 Æ lib, select the j2ee.jar, and click OK (Figure | 2-11).

Figure 12-11 Selecting a runtime JAR file

Repeat this sequence by extending the ECLIPSE_HOME variable, and select these JAR files:

runtimes/base_v7/derby/lib/derby.jar

runtimes/base_v7/plugins/com.ibm.ffdc.jar

runtimes/base_v7/plugins/com.ibm.ws.jpa.jar

runtimes/base_v7/plugins/com.ibm.ws.prereq.commons-collections.jar

The Libraries tab shows now the extra JAR files (Figure | 2-12).

Figure 12-12 Library tab with five extra JAR files

Click OK to close the Properties dialog.
ibm.com/redbooks