Difference between revisions of "Java JNA Wrapper"
(started JNA wrapper page)
Revision as of 21:06, 17 December 2010
Effort to create a Java JNA (Java Native Access) wrapper for libfreenect.
JNA provides Java programs easy access to native shared libraries. See https://jna.dev.java.net/
Who is involved
Coordinator/Development: Mark Renouf
These are command line instructions and don't make many assumptions about configuration Java class paths or native library paths. Since only only JAR (jna.jar) and one native library (libfreenect) are needed, we assume that you'll put a copy of each in a relative path directory. This could be made even simpler if your classpath and library environment variables are properly tuned, but this approach should work they are not.
1. Install libfreenect based RedHat/Fedora instructions here: http://openkinect.org/wiki/Installation/Compilation_Guides Until JNA code has been merged into https://github.com/OpenKinect/libfreenect.git you'll need to work with the java-updates branch of tweakt's fork:
$ git clone https://github.com/tweakt/libfreenect.git $ cd libfreenect $ git checkout java-updates
Note that you probably don't have to go beyond the "clone the repository" step, but probably a good idea to make sure that glview is working before proceeding.
2. Move to the Java wrapper directory:
$ cd ./wrappers/java/
3. Make a ./lib directory and a ./jars directory
4. Download jna.jar into ./jars (available from https://jna.dev.java.net/servlets/ProjectDocumentList)
5. Copy the libfreenect library (e.g. libfreenect.so.0.0.1) into ./lib
6. Build the libfreenect JNA jar:
$ rm -r ./tmpjar $ mkdir ./tmpjar $ javac -d ./tmpjar -classpath ./jars/jna.jar ./src/main/java/org/openkinect/freenect/*.java $ jar -cvf ./jars/freenect-jna.jar -C tmpjar org $ rm -r ./tmpjar