This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes UnsatisfiedlinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "UnsatisfiedlinkError" Watch "UnsatisfiedlinkError" New topic
Author

UnsatisfiedlinkError

Swapnil Sanghai
Ranch Hand

Joined: Dec 05, 2011
Posts: 41

Hello friends,
I compiled the c code and made a .dll file. Now I am trying to load it using the System.load(path); here path is the absolute path to .dll file I made using the JNI, but it is giving me an UnsatisfiedLinkError with many other things in the browser. To be honest I don't what it means except that UnsatisfiedLinkError. One more thing when I used the System.loadLibrary(name), here name is the name of the .dll that I am loading in my program with the .c, .java and .class all in the same directory it is running well and shows the desired output. Now I changed the directory of th e .dll file. Can any one tell me where I made mistake.
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1505
    
    5

Hi Swapnil Sanghai,

Please CarefullyChooseOneForum. I doubt if this question is related with SCJP/OCPJP.

You can request forum moderator to move the post to appropriate forum, or wait till someone moves it. Please do not start another thread on different forum.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

UnsatisfiedLinkError means that Java cannot find your DLL.

Define a system property named java.library.path that points to the directory that contains the DLL. You can do that on the command line with the -D option when you start your program, for example like this:

java -Djava.library.path=C:\MyProject\MyDllDir com.mypackage.MyProgram


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnsatisfiedlinkError