That question seems to be backwards as JNI is meant to allow Java to use things written in other languages, not the other way around. Now, if that question is to "use printf from C in Java" then I would understand it, and that tutorial would help. IOW, find the library in which C's printf resides and write a JNI interface to that.

That question seems to be backwards as JNI is meant to allow Java to use things written in other languages, not the other way around. Now, if that question is to "use printf from C in Java" then I would understand it, and that tutorial would help. IOW, find the library in which C's printf resides and write a JNI interface to that.

i have never learned JNI nor anything related to it :( i read that whole page but didn't find the specific answer !

is it the answer??
http://nicolas.blancpain.free.fr/Documents/Java/online/AppendixB.html

Edited 6 Years Ago by Xufyan: n/a

i have never learned JNI nor anything related to it :( i read that whole page but didn't find the specific answer !

Because that page won't give you "the specific answer" (i.e. cut-n-paste code). It tells you how JNI works and shows you how to do it, but it is not a cut-n-paste do my work for me site, of course.

And, of course, the statement about "never learned anything about JNI" is meaningless as that is what that tutorial is teaching, of course.

Edited 6 Years Ago by masijade: n/a

This article has been dead for over six months. Start a new discussion instead.