This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling .java file to shared library



On Tue, 26 Sep 2006, Mike Purdy wrote:


So, now I've successfully applied the dawrin x86 patches to a 4.0.2 tarball and have successfully built it.

Now, I would like to take a .java file and compile it into a native shared library so that I could link and use it in a c++ application. gcj -c -g -O MyLibrary.java successfully creates an .o file. What is the next step to making a shared library?

To use it from C++, you have to generate a C++ header file for your class using gcjh and use that to compile calls into it.


I do something very similar when building PyLucene (a shared library serving as a python extension integrating Java Lucene). Take a look at its Makefile for examples:
http://svn.osafoundation.org/pylucene/trunk/Makefile


Andi..


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]