jni test case question/ linking

Andreas Tobler toa@pop.agri.ch
Wed Feb 19 17:07:00 GMT 2003


Ranjit Mathew wrote:
>>Does the call    System.loadLibrary ("field"); assume that it is an .so
>>file?
>>
>>Or may I have some PATH settings to adjust?
>>
>>I run this on darwin, where .so = .dylib.
>>The point is, do I have to add the ability to load .dylib files in java?
> 
> 
> See java::lang::Runtime::_load( ) in "java/lang/natRuntime.cc" - as
> I understand it, you should define _Jv_platform_solib_prefix and
> _Jv_platform_solib_suffix approrpriately ("" and ".dll" respectively
> on Win32 (win32.h) and "lib" and ".so" respectively on POSIX (posix.h)).
> 
> See "libltdl/ltdl.c" for the code that actually loads a DLL/.so - if 
> these mechanisms suffice for a .dylib, I guess you're done.

Thanks for the quick hint. I have to dig into ltdl.c.
Simply changing the shared suffix didn't help :)

But first I have to find out how to make my gcc libs shared.

Andreas




More information about the Java mailing list