[Xapian-devel] Java Bindings on a Mac

John Schult schulty at gmail.com
Sun Feb 4 16:59:12 GMT 2007


I had to make some changes (sorry no diff available) to "configure" in
0.9.9 of the bindings so that I could compile them for OS X 10.4.8.
Essentially I replaced the the paths to jni.h with
/System/Library/Frameworks/JavaVM.framework/Headers.  It compiled
without error and created both libxapian_jni.so and xapian_jni.jar in
the "built" subdirectory when I ran "make install".

When I ran the example code (from the "java" directory) I got the following:

$ java -Djava.library.path=built -classpath built/xapian_jni.jar:. \
>       org.xapian.examples.SimpleIndex ./test.db index words like java
Exception in thread "main" java.lang.UnsatisfiedLinkError: no
xapian_jni in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at org.xapian.XapianJNI.<clinit>(XapianJNI.java:44)
        at org.xapian.WritableDatabase.<init>(WritableDatabase.java:42)
        at org.xapian.examples.SimpleIndex.main(SimpleIndex.java:44)

It did not make any difference when I set LD_LIBRARY_PATH to the
absolute "built" path either.  I got the same results.  I am using the
Apple Java 5 J2SE.  Has anyone gotten the bindings to work under OS X?

-- 
john david schult
usa : georgia : buford
m: 404.510.5163



More information about the Xapian-devel mailing list