This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes JNI Tutorials Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JNI Tutorials" Watch "JNI Tutorials" New topic

JNI Tutorials

Raghuraman Muthuswamy
Ranch Hand

Joined: Mar 18, 2003
Posts: 73
Dear All,
I am going to work on a project with Java. The project involves existing C++ code into Java. I have understood that 2 ways of doing this is Corba and JNI. I want to use JNI. I need tutorials on JNI. Kindly send me which book i have to follow or good web sites which teach JNI from a beginners perspective. Your reply is very much appreciated.

Thanks in advance,

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24168

One of the best references on JNI is Sun's online tutorial on the topic here.

[Jess in Action][AskingGoodQuestions]
Dom King

Joined: May 19, 2004
Posts: 18
If you need to call existing C++ code using JNI, take a look at NewJNI, the natural C++ interface to Java. NewJNI is included free with NewJ for C++.

Things to consider:
- Full source code for NewJNI libraries is included, which can help you learn JNI.
- NewJNI is only implemented for Windows at this time, although the source code is overall very portable C++ and JNI.
Raghuraman Muthuswamy
Ranch Hand

Joined: Mar 18, 2003
Posts: 73
I tried to implement the example given in for JNI tutorials. Its the HelloWorld example. I compiled the HelloWorld program, but when the next instruction of creating a header file using javah -jni HelloWorld is not working. It says class HelloWorld could not be found. Why is this error. Your reply is very much appreciated.

Thanks in advance,

I agree. Here's the link:
subject: JNI Tutorials
Similar Threads
using JNI without knowing c/c++
Crazy Fast Square Root
Running external apps in a JFrame?
Screen Cap on Mouse Click Anywhere
I'm looking for JNI real world examples