[Kde-java] Using GCJ with KDE Java

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Mar 2 19:59:57 CET 2004


On Tuesday 02 March 2004 11:47, Daniel Hanlon wrote:
> I've managed to get a few apps working with the kdejava bindings and gcj. I
> dowloaded the kdejava and qtjava modules seperately and built them to
> create qtjava.jar and koala.jar.
>
> I then compiled the two jars with: (kde installed in /usr/kde/cvs)
>
> gcj -L/usr/kde/cvs/lib -lqtjava qtjava.jar -fjni -shared -o
> libqtjavabind.so
>
> gcj -I<path to qtjava>/javalib -L/usr/kde/cvs/lib -lqtjavabind -lkdejava
> koala.jar -fjni -shared -o libkoalabind.so
Note that for gcj you should call the libs 'lib-org-kde-koala.so' and 
'lib-org-kde-qt.so' because it depends on the library names being the same as 
the package name within the .jar file. At runtime gcj searches for .jar files 
aswell as .so files with that naming convention.

> You can check with ldd that the produced shared objects are linking
> correctly.
>
> Then, for example, the KProgressTest.java example compiles with:
>
> gcj KProgressTest.java --main=KProgressTest -o kprogresstest -lkoalabind
> -I<path>/qtjava/javalib -I <path>/kdejava/koala
>
> Whilst the resulting executable worked fine, there was clearly a problem
> somewhere (probably in libgcj?) as when I left it running for a day or so,
> it ended up using 300 odd MB of RAM....
Interesting! - I'll try the KProgressTest example with Sun's jdk and see if 
that leaks too.

-- Richard


More information about the Kde-java mailing list