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]

Static linking of JNI code - HOW?


> We are creating an application with GCJ and we wish to statically link
> our JNI code to bypass the whole shared library mess.  I have been able
> to statically link in my JNI code, but the runtime is still looking for
> the code in a lib


You need put the jni functions into jni hashtable (with RegisterNatives).
For example if you have the two functions ImageDecoderPixbuf_initState and
scanImage and you want to register them, you can use the following code
(natcStartup.c, natcStartup.h) attached.

As usual your Startup.java has to be compiled with -fjni.


Jost

Attachment: natcStartup.c
Description: Binary data

Attachment: natcStartup.h
Description: Binary data


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