Help regarding including a .lib file in Java Project using JNI

P

Prajakta Jitkar

Hi all,
I have some .lib files developed in C++. I want to develope
my application in Java which can make use of methods defined in
those .lib files. I am trying to use JNI to resolve my problem, but I
am not able to include the .lib files in my Java project.
Can someone help me regarding the same?

I am using Java 1.5 and using Eclipse.

Thanking you in anticipation
Prajakta
 
G

Gordon Beaton

I have some .lib files developed in C++. I want to develope my
application in Java which can make use of methods defined in those
.lib files. I am trying to use JNI to resolve my problem, but I am
not able to include the .lib files in my Java project.

There should be some header files as well. You *include* the header
files in your (native) code, and *link* with the library files.

But in order to use the lib files with JNI, you must have a shared
library or DLL specifically made for use with Java that follows the
naming and linking rules of JNI. It will contain native declared
methods that belong to the Java classes in your project.

You cannot use an arbitrary library directly from Java, but you can
use its functions from a properly created JNI shared library.

To get started with JNI, read here:
http://java.sun.com/docs/books/jni/index.html
http://java.sun.com/javase/6/docs/technotes/guides/jni/index.html

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top