JNI?

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?

I know you hate people giving you google links, but even so:

http://www.google.com/search?hl=en&q=jni&btnG=Google+Search

Gives you rather alot of tutorials and technical details - lets look at the first few links:

http://java.sun.com/j2se/1.4.2/docs/guide/jni/ - A page on JNI with links to the specifications
http://en.wikipedia.org/wiki/JNI - Wikipedia on JNI, a really long full description of what it is
http://www.javaworld.com/javaworld/jw-10-1999/jw-10-jni.html - A Java world tutorial on how to use JNI
http://www.jguru.com/faq/JNI - A FAQ on JNI at JGuru
http://ringlord.com/publications/jni-howto/ - A step by step guide on how to use JNI under unix
http://www.acm.org/crossroads/xrds4-2/jni.html - A generic step by step guide for JNI

Now, I just typed “jni” into http://www.google.com.

GOOGLE IS YOUR FRIEND.

say it with me now

GOOGLE IS MY FRIEND.

Kev

GOOGLE IS MY FRIEND.
I WILL GET MARRIED TO GOOGLE.
GOOGLE IS MY LIFE.
GOOGLE IS MY WIFE.

Better? ;D

On another note, if you find yourself doing most of your work in C/C++ and sticking it into Java on a small project then you may want to switch completely to C/C++. :wink:

my friends usually use [warning: offensive material] this [/warning] when i ask those kind questions

that is unlikley becouse i do not know C or C++

so why do you want JNI?

* darkprophet is confused

DP

Because it’s cool, obviously. ::slight_smile:

You should throw in some AJAX and Web 2.0. All the cool kids are doing it.

How about using wikipedia for a change? Then you don’t even have to filter google search results, and there are probably links from the wikipedia article to tutorials. Google is so 2004.

While I’m not up there with the cool people, I’ve seen amateur developers also go with “the cool” when it comes to languages, which is probably why we see a lot of A vs B.

javah.exe creates all method names for you.
It’s stdcall.
don’t forget to set JNI type.

Look at Sun JNI tutorial.

He wants to use ASM of course.