[fedora-java] How to link C++ code to a java library?

Orcan Ogetbil orcanbahri at yahoo.com
Wed Nov 19 06:14:33 UTC 2008

I recently got this query for itext [1] that is maintained in Fedora by me. I've been asked to provide a "JNI subpackage" [2]. Unfortunately, I am not familiar with JNI.

This person wants to package pdftk [3], which is a c++ application. The original pdftk code contains an old version of itext and it links to it statically. Meanwhile, the old version of itext had licensing issues and it had been removed from Fedora almost 2 years ago. But these issues got resolved recently and I packaged itext for Fedora once again. Now the question is: Can we link pdftk dynamically to new itext we have on the system?

After some consultation in IRC, I've been told that JNI is not what we need in this case. And a suggestion came up: Apparently we can use GCJ to do this job. But this will require non-trivial hacking. Can anyone point me to some guidelines for this and/or give me a head-start?



[1] http://www.lowagie.com/iText/download.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=471811
[3] http://www.pdfhacks.com/pdftk/


More information about the java-devel mailing list