[Xapian-discuss] java bindings 1.0.0 - jni.h not found
Martin Kuen
martin.kuen at gmail.com
Wed May 30 18:21:31 BST 2007
hi,
thanks for telling me about config.log.
Yes the "jni.h" file is found but not picked up.
from "configure.log":
- configure:15431: checking for jni.h in /usr/lib/jvm/java-
1.5.0-sun-1.5.0.11/include
- configure:15442: g++ -c -g -O2
-I/usr/lib/jvm/java-1.5.0-sun-1.5.0.11/include
conftest.cpp >&5
- In file included from conftest.cpp:1:
- /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/include/jni.h:27:20: error: jni_md.h:
No such file or directory
I found the problem and the java-binding compiles now with "make check" and
passes the test.
The problem is that the header-file "jni.h" includes another file called
"jni_md.h" (#include "jni_md.h"). This file is in a system-specific
subdirectory of "path-to-jvm/include", that is called sth. like solaris,
linux or windows.
read: http://java.sun.com/products/jdk/faq/jni-j2sdk-faq.html#jni_md
The the configure script has to add this subdirectory to the buildpath as
well.
To make it work for me I simply copied the "jni_md.h" file into the parent
directory ("path-to-jvm/include").
Configuring works and the "make check" is fine as well.
Thanks to all of you for all the quick replies.
Cheers,
Martin
On 5/30/07, Olly Betts <olly at survex.com> wrote:
>
> On Wed, May 30, 2007 at 05:28:48PM +0200, Martin Kuen wrote:
> > Point of failure:
> > checking for jni.h... no
> > checking for jni.h in /usr/lib/jvm/java-1.5.0-sun/include... no
> > checking for jni.h in /usr/lib/jvm/java-gcj/include... no
> > checking for jni.h in
> > /System/Library/Frameworks/JavaVM.framework/Headers... no
> > configure: error: jni.h not found
> >
> > Note that I have added JAVA_HOME to my path and if I look into the
> directory
> > "/usr/lib/jvm/java-1.5.0-sun/include" there is a "jni.h" file - This
> > directory does not appear if I don't set JAVA_HOME.
>
> As James says, config.log should show why this jni.h isn't being picked
> up. The test just tries to compile:
>
> #include <jni.h>
>
> > Next I tried to set the variable JNI_INCLUDE_DIR. No effect at all.
>
> JNI_INCLUDE_DIR is never actually used! I'll fix that, but the problem
> here seems to be the test for jni.h.
>
> > OS: Ubuntu 7.04
> > gcc/g++: Ubuntu 4.1.2-0ubuntu4 (gcc/g++ version 4.1.2 as ubuntu package)
>
> That's what I'm using, so if it's not obvious what's up from config.log
> I can investigate.
>
> Cheers,
> Olly
>
More information about the Xapian-discuss
mailing list