OpenJPA Logo   ASF Logo

The first runtime enhancement method is to provide a javaagent when launching the JVM that OpenJPA is going run in.


For Eclipse, specify the above javaagent value on the Run Configuration page.

For ANT, provide the javaagent value as a jvmarg when launching an application. Below is a snippet that shows how to pass in the javaagent when launching a Java SE application that uses OpenJPA.

    <path id="jpa.enhancement.classpath">
        <pathelement location="bin"/>
        <!-- lib contains all of the jars that came with the OpenJPA binary download -->
        <fileset dir="lib">
            <include name="**/*.jar"/>
    <target name="drive" depends="clean, build">
        <echo message="Running test with run time enhancement."/>
        <java classname="main.Driver" failonerror="true" fork="yes">
            <jvmarg value="-javaagent:${openJPA-jar}"/>
            <classpath refid="jpa.enhancement.classpath"/>
Copyright © 2006,2020 The Apache Software Foundation. Licensed under Apache License 2.0.
Apache, the Apache feather logo and OpenJPA are trademarks of The Apache Software Foundation.
Other names may be trademarks of their respective owners.