Michael,
Thank you very much for the JNI wrapper. I'm running Fedora 12 (32-
bit) so I thought I'd share what was needed to run your Example.java
for that setup. I believe this would be helpful for anyone trying to
run the example who has not worked much with JNI. The only assumption
I make in these instructions is that the user has a proper JDK
installed.
1. Install libfreenect based on your repository. See the RedHat/
Fedora instructions here (
http://openkinect.org/wiki/Installation/
Compilation_Guides), but substitute
https://github.com/michael-nischt/libfreenect.git
for
https://github.com/OpenKinect/libfreenect.git (until your code has
been merged into the main repository). 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 ./libfreenect/wrappers/java/
3. Tweak build.sh as needed. For me this involved removing the "-m64"
g++ option, changing the line "LIBFREENET_LIBRARY=../../lib/
libfreenect.a" to "LIBFREENET_LIBRARY=../../build/lib/libfreenect.a",
and changing "JDK_HOME" to "JAVA_HOME" (just added "JDK_HOME=$
{JAVA_HOME}" before "JNI_SRC_DIR=OpenKinectJNI"
4. Build the jar: "sh build.sh"
5. Compile the demo: "javac -d ./ -classpath .:./dist/OpenKinect.jar ./
OpenKinect/src/Example.java"
6. Move to the executable directory: "cd dist"
7. Change to root: "su"
8. Run the demo: "java -Djava.library.path=. -classpath .:./
OpenKinect.jar Example" Note that the -Djava tells Java where to look
for the native library. Even though libOpenKinect.so is in the
"dist" (current) directory, Java won't see it without the "-D" option
(at least it wouldn't for me - I was getting "Exception in thread
"main" java.lang.UnsatisfiedLinkError: no OpenKinect in
java.library.path")
The demo created two jpg files in the current user's directory ("/
root" for me): "kinect.color.jpg" & "kinect.depth.jpg" If you have
those files, you've succeeded.
Regards.
-Brian