Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNI Tutorials

 
Raghuraman Muthuswamy
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,

Regards,
Raghu
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the best references on JNI is Sun's online tutorial on the topic here.
 
Dom King
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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++.

http://www.pure-native.com/newj.html

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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I tried to implement the example given in java.sun.com 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,

regards,
Raghu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic