• Post Reply Bookmark Topic Watch Topic
  • New Topic

using JNI and shared Library  RSS feed

 
Allen Smith
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to call C routines from my java app. I have successfully built and loaded the shared library, but I am getting an UnsatisfiedLinkError trying to reference any of the routines. My java file is in a package and I think that is my problem.

When I run 'nm' on the shared library I see the routines as Java_ClassName_routine, but I don't see the package name. I think that when I run my java app, the referencing is using the package name???

Here is my javah command...

javah -jni ClassName

Any suggestions?
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you specifying th efully qualified class name?


[/CODE]
 
Allen Smith
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
found the problem...I was running javah from within the directory the .java file resides. Because of this I didn't need to specify the full path when I executed javah. Once I ran javah from the parent directory the .h file had the full package_ClassName_subprogram name, everything worked much better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!