Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Prajakta Jitkar - 27 Feb 2007 13:32 GMT
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
Gordon Beaton - 27 Feb 2007 13:47 GMT
> 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

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.