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 / Tools / April 2004

Tip: Looking for answers? Try searching our database.

eclipse and jni

Thread view: 
Johan - 23 Apr 2004 07:28 GMT
Hi

What do I have to install for working with JNI. What plugins do you need and
where can you download it

Thanks

Johan
Dave Neary - 23 Apr 2004 09:46 GMT
Hi,

> What do I have to install for working with JNI. What plugins do you need and
> where can you download it

I don't know of any specific Eclipse plug-ins you can install to make things
easier, but once you have a C development environment and a Java SDK, you
can do JNI.

The process is generally:
1) Write your .java with the methods you want to delegate to external
libraries marked as "native".
2) From these .javas, run javah -jni MyClass.java -o MyClass.h to generate
the (C) header files for your native interface
3) Write the .c corresponding to the .h which actually makes the call to
the native library, and
4) Compile the cs into a .dll (or .so), linking in your native library, add
a loadLibrary in your java, and make sure the so is available at runtime to
the jvm, and you're done.

Cheers,
Dave.


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.