1. This page descrives JOM - the Java JNI openModeller interface
Contents
1.1. Prerequisites
In order to build JOM from source you need:
- libopenmodeller and libopenmodellerxml must be compiled and available on your system. This is described elsewhere on this wiki
- Java 5 (may work with earlier versions but untested) SDK
- Ant
- Optionally Eclipse
1.2. Checkout Source from CVS
Anonymous access:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openmodeller login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openmodeller co -P jom
Developer access:
export CVSROOT=[your_sf_user_name]@cvs.sourceforge.net:/cvsroot/openmodeller
export CVS_RSH=ssh
cvs co jom
1.3. Tweak the build.xml
Edit jom/build.xml and update the line indicated with '<--' below
» <!-- ==================== c-compile Target ================================== -->
» <target name="c-compile" depends="jni-compile" description="Compile cpp code">
<property environment="env" />
<echo message="${env.JAVA_HOME}/include"/>
<echo message="${env.JAVA_HOME}/include/linux"/>
» <cc link="shared" outtype="shared" multithreaded="true" optimize="speed"
» objdir="${cpp.home}" outfile="${cpp.home}/omjniadapter">
» <compilerarg value="-Wall"/>
» <compilerarg value="-D_JNI_IMPLEMENTATION_"/>
» <compilerarg value="-fno-strict-aliasing"/>
» <linker name="g++">
» <linkerarg value="-lopenmodellerxml"/>
» </linker>
<fileset dir="${cpp.home}" includes="omjni.cpp"/>
» <includepath>
» <path path="${env.JAVA_HOME}/include"/>
» <path path="${env.JAVA_HOME}/include/linux"/>
<path path="/home/aps02ts/dev/cpp/om/src/console"/> <-- set this to something suitable!
» <path path="${basedir}/stub"/>
» <path path="${build}"/>
» </includepath>
» </cc>
» </target>
1.4. Build JOM from the command line