David DeHaven <david.deha...@oracle.com> wrote:

> Are you linking against JavaVM.framework? If you just need the JNI
> headers, it's better to use those provided in the JDK (the headers are
> even correct these days...). You shouldn't need to link anything to
> just open and use libjvm. This is generally true for JNI libraries too
> since native methods are dynamically looked up by symbol name. So,
> instead of "-framework JavaVM" use "-I${JDK_HOME}/include
> -I${JDK_HOME}/include/darwin" and it will find jni.h (assuming
> JDK_HOME is defined and correct).

Follow-up question here: I'm trying to use autoconf to identify the
location of the proper include directories and libraries for subsequent
use of libtool to create a .libjni JNI dynamic library.  The Mac's
/usr/libexec/java_home will identify JAVA_HOME; is there some way to
test for the location of the jni_md.h file that is platform-specific?
Is there some standard JDK tool that, when run, will produce the
appropriate include directories?

Or, is there some way to detect these configuration details by compiling
and running a Java program that autoconf could then use as an auxiliary?

Thanks.

Bill

Reply via email to