• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI gives UnsatisfiedLinkError

 
Prabhu Baskaran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to call a C code from java. I wrote a simple program and followed
the step as mentioned in http://www.javaworld.com/javaworld/javatips/jw-javatip23.html
but i cud not run the java file. It gives me following error java.lang.UnsatisfiedLinkError

Any one have clues whats wrong.

Regards
Prabhu
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

The three most likely causes:

1) Your functions are named incorrectly; be sure to use the prototypes defined by the javah tool.

2) Your linker or compiler options were not correct, so the DLL (or .so) doesn't contain the right symbols

3) The DLL isn't on your PATH (or the .so isn't on your LD_LIBRARY_PATH or java.library.path
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!