Home arrow static arrow Java Programming [Archive] - how to calling c code from a static library via JNI
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - how to calling c code from a static library via JNI
This topic has 2 replies on 1 page.

Posts:9
Registered: 6/30/04
how to calling c code from a static library via JNI  
Jun 30, 2004 10:34 PM



 
only have a static library file : libXXX.a
failed always:(
 

Posts:2,399
Registered: 9/8/98
Re: how to calling c code from a static library via JNI  
Jul 1, 2004 1:21 AM (reply 1 of 2)



 
Write a wrapper for your static library. The wrapper will be statically linked to the lib but will be
dynamically loadable itself. Therefore you can load it from java.

Write a C/C++ program that is statically linked to the library. Then initialise the JVM from inside
that program. This means that the lib should be visible to JNI


matfud

 

Posts:18
Registered: 6/25/03
Re: how to calling c code from a static library via JNI  
Jul 1, 2004 2:43 AM (reply 2 of 2)



 
This JNI trail explains everything (about JNI!)
http://java.sun.com/docs/books/tutorial/native1.1/
 
This topic has 2 replies on 1 page.