[Kde-java] Re: [Kde-bindings] JNI library names

Dominique Devriese dominique.devriese at student.kuleuven.ac.be
Mon Mar 29 15:48:47 CEST 2004


Richard Dale writes:

> On Monday 29 March 2004 10:11, Dominique Devriese wrote:
>> Hi,
>>
>> I have a question about the naming scheme of the JNI libraries in
>> kdejava and qtjava.  Apparently, gij expects them to have a name
>> like "lib-org-kde-qt.la", instead of the current libqtjava.la.  Am
>> I misinterpreting something, or should they really be renamed ?
> lib-org-kde-qt.so is a different library to libqtjava.so, it is just
> the interfaces in qtjava.jar compiled to a library. You still need
> libqtjava.so as well.

Sorry, can you explain this to me ?  AFAIU, the idea behind JNI is
that you make a few class files which have some methods declared
"native", and for each of these methods, a C function is created with
a name derived from the java method name.  IIUC, these C functions are
defined in libqtjava.so.  Now what I'm not sure about is how the java
vm is supposed to find the library in which these C functions are
defined.  I assume it looks for a library name like
"lib-org-kde-qt.la", is this not correct ?

Anyway, the reason I'm asking this is because I have some debian
packages built, but they're unusable, because the gij interpreter
complains about a NoClassDefFoundException when trying to load the
qtjava class.  I strace'd the process to see what it was trying to do,
and it opened the qtjava.jar file fine, and then started looking for a
library with a name like "lib-org-kde-qt.la".  I assumed the JNI lib
was misnamed.

> But the combination of lib-org-kde-qt.so and lib-org-kde-koala.so is
> so large that the memory occupancy of a simple program I tried went
> up from 25 Mb to 50 Mb. If gij finds a library lib-org-kde-qt.so it
> will use it instead of qtjava.jar, so it really extends the idea of
> .jar files/classpaths to work with libs too.

Oh, so this "lib-org-kde-qt.so" library is the gcj-compiled "native"
version of the classes.  But how then is gij supposed to find the
library in which the JNI functions are defined, and why won't it run
my test app ? :)

cheers
domi


More information about the Kde-java mailing list