java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path

blayfk used Ask the Experts™
I  have some .dll files(jhdf5.dll and jhdf.dll) in win folder I will like to load on windows XP.
I first tried the following two setups  in my batch file but I'm still getting errors

1. java -Djava.library.path=./plugins/ncsa.hdf/resources/win/
2. java -Djava.library.path=C:/myProduct/plugins/ncsa.hdf/resources/win/

Can someone tells me whats wrong with my settings
java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at ncsa.hdf.hdf5lib.H5.<clinit>(
        at ncsa.hdf.hdf5lib.HDF5Constants.<clinit>(
        at ncsa.hdf.object.h5.H5File.<init>(
        at ncsa.hdf.object.h5.H5File.<init>(
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2009

Your lib path is incorrect -

Check the link and see the path as it dependent on the OS
Top Expert 2016

 java -Djava.library.path=./plugins/ncsa.hdf/resources/win/;C:/myProduct/plugins/ncsa.hdf/resources/win/
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Top Expert 2016

No. Try
 java -Djava.library.path=.\plugins\ncsa.hdf\resources\win\;C:\myProduct\plugins\ncsa.hdf\resources\win

Open in new window

Top Expert 2016

I would make both paths absolute though

Also check follwonig
if you are using System.load(...), pass the complete file name with extension and path

Alternatively you can use System.loadLibrary(...),where you do not pass the library extension, just add your library path to java -Djava.library.path

and try
>>java -Djava.library.path=./plugins/ncsa.hdf/resources/win/
java -Djava.library.path=C:/myProduct/plugins/ncsa.hdf/resources/win/

you have to combine above and pass it as vm arguments in the app launch command! for e.g.,

java -Djava.library.path=C:\myProduct\plugins\ncsa.hdf\resources\win\;C:\myProduct\plugins\ncsa.hdf\resources\win "CALSSPATH HERE" "YOUR STARTUPCLASS"


      your link is helpful but what I want to do is set these .dll in my application so that a user will run the application straight away but not necessarily setting the environmental variables. I run my application from run.bat or .exe files.

then you set environment variables in your bat file. Keep your libraries in your JDK lib folder.
I believe any way you will be providing JAVA_HOME.
This solved the problem for me.
java -Djava.library.path=./plugins/ncsa.hdf/resources/win/  startup.jar

In addition this I needed to install C++ runtime on my machine. One can get more details from

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial