| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 06/30/2006 20:22:46
|
harry@dayfamilyweb
Newbie
Joined: 06/30/2006 20:05:00
Messages: 2
Offline
|
recently Ive 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?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/02/2006 22:31:58
|
stdunbar
Newbie
![[Avatar]](/images/avatar/a87ff679a2f3e71d9181a67b7542122c.png)
Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline
|
I liked the the answer you got in your crosspost.
|
Thanks for using the forums at hotjoe.com |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/04/2006 04:48:01
|
harry@dayfamilyweb
Newbie
Joined: 06/30/2006 20:05:00
Messages: 2
Offline
|
like i told you before i almost always post on multtipule forums
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/05/2006 12:51:22
|
stdunbar
Newbie
![[Avatar]](/images/avatar/a87ff679a2f3e71d9181a67b7542122c.png)
Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline
|
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.
I wouldn't exactly consider JNI to be a "framework". It is a means of accessing some sort of platform specific behavior from Java.
|
Thanks for using the forums at hotjoe.com |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/05/2006 17:22:38
|
mrider
Newbie
Joined: 10/25/2005 11:50:02
Messages: 25
Offline
|
A little used (so far as I know anyway), but legitimate use for JNI would be to provide a Java API to hardware. Take a look at the following post for an example of what I mean: http://forums.hotjoe.com/posts/list/274.page.
I have no personal experience to back this up, but it seems to me that with hardware like that it would be in everybody's 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.
So from that perspective, JNI could be used in places where it's necessary to "get close to the metal".
|
|
|
 |
|
|