Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Awkward question regarding JNI

 
Shyam Purkayastha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
i have got a piculiar question regarding jni.i am a newbie in jni and have tried basic programs from the sun java tutorial.It really worked.
I understand that the method has to be defined as native and the corrosponding code has to be written in c and created into a library file.But whatever examples i have seen uptil now have involved calling only individual methods.Suppose that i have a C++ class library which i want to use in a java program.Obviously it is better to call the library using jni than to create the java equvalent of the library.I want to know wheather it is possible to call c++ objects and their corrosponding methods using jni and if yes then how.
I tried this concept by creating a small class and making objects of it inside a native method but my visual c++ compiler is giving all sorts of errors.Can anybody help.
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic