File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes java.lang. UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "java.lang. UnsatisfiedLinkError" Watch "java.lang. UnsatisfiedLinkError" New topic

java.lang. UnsatisfiedLinkError

Liz Costelloe

Joined: Nov 01, 2003
Posts: 17

I'm trying to link an applet to a Fortran DLL through a servlet using JNI. Originally I tried to directly communicate between the Applet and Fortran however security permissions were blocking the communication. The sun tutorial on Applets does mention that applets can't do this.

So I've introduced a Servlet to allow the Applet and Fortran to communicate. My problem at the moment is that I get the following error when I try to load the dll to the Servlet:

java.lang.UnsatisfiedLinkError: no fortran.dll in java.library.path

I'm using the following command to load the DLL


I've tried replacing fortran.dll with


I've also tried editing system.library.path to include the address of the server.

I'd very much appreciate any suggestions on this,
Many thanks.
[ June 06, 2006: Message edited by: Liz Costelloe ]
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
If you follow the trail through the JavaDocs, you end up at findLibrary

The loadLibrary method depends on the system variable java.library.path which for most servers isn't set to anything. If you read through the documentation of your server, each has a way to set system variables at startup time. Tomcat, you add a system variable called TOMCAT_OPTS something like
set TOMCAT_OPTS=-Djava.library.path=[path to dll]

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Harpreet Hira
Ranch Hand

Joined: Sep 27, 2001
Posts: 72
Try including the path of DLL in PATH environment variable OR
Else, if you are on Windows OS, put it in System32 folder.
Liz Costelloe

Joined: Nov 01, 2003
Posts: 17

Thanks for your responses. Problem solved, I've put the DLL in the system32 folder for the moment and it's loading with no problems now.

I'll look into setting java.library.path now that I know the DLL works and isn't the source of the problem.

Many thanks, very grateful.
I agree. Here's the link:
subject: java.lang. UnsatisfiedLinkError
jQuery in Action, 3rd edition