FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Fedora Development Java

 
 
LinkBack Thread Tools
 
Old 11-19-2008, 06:14 AM
Orcan Ogetbil
 
Default How to link C++ code to a java library?

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

Thanks,
-oget


Refs:

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





--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 11-19-2008, 08:33 AM
Mark Wielaard
 
Default How to link C++ code to a java library?

Hi Orcan,

On Tue, 2008-11-18 at 22:14 -0800, Orcan Ogetbil wrote:
> 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?

The program, pdftk, is a c++ program that uses gcj's CNI (not JNI)
feature to call java classes. Here is some background information on
CNI: http://gcc.gnu.org/onlinedocs/gcj/About-CNI.html

In principle you would only need to provide CNI headers for the itext
classes (see gcjh) and a shared library build from the itext classes or
jar file (see gcj). But it depends a bit on coordinating with the pdftk
packager. Currently the pdftk build seems to just bundle all of itext
and compile it into one big static library.

Cheers,

Mark

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 

Thread Tools




All times are GMT. The time now is 06:38 AM.

VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org