Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2007, 04:37 PM
Member
 
Join Date: Jun 2007
Posts: 92
Daniel is on a distinguished road
Help with JNI
recently I have seen lots of java articles mentioning JNI.
what is JNI? what is its purposes? how do you use JNI? is the any tutorials on JNI?

Thanks.

Daniel
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-02-2007, 04:41 PM
Senior Member
 
Join Date: Jun 2007
Posts: 111
Eric is on a distinguished road
Ok, well then - JNI is the Java Native Interface. It is a means of using a native (that is, O/S and platform specific) library from within Java. Java and the native library can send data structures back and forth and call methods back and forth. It is most commonly used with C and C++ programs though that is not a requirement.

By definition the use of JNI mean that your code is no longer portable as it isn't 100% Java. You would have to distribute platform specific binaries with your Java just as you would if you coded in C.

A common use is for vendors who don't really want to write in Java and have an already existing native code library. They provide a thin JNI wrapper over the native library and poof - they have Java support.

Greetings.

Eric
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-02-2007, 04:47 PM
Senior Member
 
Join Date: Jun 2007
Posts: 114
Albert is on a distinguished road
A little used, but legitimate use for JNI would be to provide a Java API to hardware.

I have no personal experience to back this up, but it seems to me that with hardware like that it would be in everybody best interest to provide the smallest native lump possible, and then provide as much portable code as possible. Code that comes with a device like that is just overhead, it's not the main order of business. If I were designing the interface for that printer (or something similar), I'd be championing Java. It only makes sense.

Greetings.

Albert
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 02:47 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org