>> 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.

You should be using .dylib for JNI libs these days.


>  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?

Not really. The include directory is always the same on any platform: 
${JDK_HOME}/include and on OSX you also include the darwin directory for the 
machine dependent files. I don’t forsee this changing any time soon, so the 
only thing I’d do that involves autoconf is detect if you’re building on OSX 
and add the darwin directory.

-DrD-

Reply via email to