PathEngine home | previous: | next: |
The JNI mapping for PathEngine is built into a special version of the run-time library, and this page explains how to build this run-time library version.
At the time of writing, the JNI mapping has been tested on Linux platforms, and project configuration is supplied for these platforms, with the python build scripts. (If you need JNI support on Windows let us know, and it should be straightforward to add this.)
You'll need the Java SE installed ('Java Platform, Standard Edition'), which will usually come in the form of either the OpenJDK or Oracles JDK implementation. Many Linux distributions will come with this already installed, but you'll need to find out which JDK is active (if multiple JDK versions are installed), and the location of the JDK c++ headers.
You'll need to build the 'PathEngine_JNI' shared object project, with the root project source file located at 'SDKRoot/code/project/so/PathEngine_JNI.cpp'.
This is a standard PathEngine project, and you can build this project with the instructions on this page:
One way to locate your JNI include directories is to find what typing 'java' executes, and following symbolic links, e.g. with 'readlink -f $(which java)'. This should return something like '/usr/lib/jvm/jdk1.7.0_25/bin/java', and in this case the JNI includes can be found in '/usr/lib/jvm/jdk1.7.0_25/bin/java/include'.
You'll need to add the JNI include directories to the PathEngine include scripts in order for the PathEngine_JNI project to build. Open 'SDKRoot/python/buildScripts/MakeProject.py' and look for commented lines showing how to do this. Note that two additional include directories are required if you are using the Oracle JDK (the include directory itself, plus a 'Linux' subdirectory), whereas just one additional include directory is required with OpenJDK.
After adding the JNI include directories, and running the python build scripts you should end up with the target libPathEngine_JNI.so file in something like 'SDKRoot/build/GCCx64/Debug/so/' (for the 'GCCx64' build platform and debug configuration).
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |