Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI Question  RSS feed

 
Bill White
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done some very simple hello world type JNI but now I am moving on.
I am having a problem with one thing though. My question is. When your Java class resides in a package com.package.myPackage does your method call in the native code have to be something like:
JNIEXPORT void JNICALL
Java_com_package_myPackage_MyClass_nativeMethod(...) ?
or can I still get away with
JNIEXPORT void JNICALL
Java_MyClass_nativeMethod(...) ?
I am getting an unsatisfied link error with the latter. But I have double checked everything. Spelling is ok etc.... The only diff is my first attempts were not in a package, my current attempts are.
Thanks
 
Bill White
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind. I answered my own question. Yes, you do have to fully qualify the path to the method you are calling by including the package the class belongs in into the method name.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!