Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNI Problem -Help!

 
kailas simha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying some examples on JNI but an stuck with this problem. Running on Win NT 4.0 with Dev-C++. (Have Cygwin also).
Can somebody help!!
When I run my java class file, I get this exception. What am I doing wrong here?
Exception in thread "main" java.lang.UnsatisfiedLinkError: print
at MyWorld.print(Native Method)
at MyWorld.main(MyWorld.java:12)
Thanks in advance,
Kailas
 
Karl Laird
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this could be caused by many problems including problems in the javah header file, no header file, not being able to find the C dll, etc.
Can you post your java code, c header file and c code - this would make debugging alot easier
 
Servin Park
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kailas,
Try the following:
instead of System.loadLibrary("yourDLL");
try using System.load("C:/path/to/your/yourDLL.dll");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic