Link to home
Start Free TrialLog in
Avatar of blayfk
blayfk

asked on

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

hi
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>(H5.java:234)
        at ncsa.hdf.hdf5lib.HDF5Constants.<clinit>(HDF5Constants.java:494)
        at ncsa.hdf.object.h5.H5File.<init>(H5File.java:167)
        at ncsa.hdf.object.h5.H5File.<init>(H5File.java:106)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Avatar of a_b
a_b

Your lib path is incorrect - http://www.hdfgroup.org/hdf-java-html/hdf-object/use.html#libpath

Check the link and see the path as it dependent on the OS
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No. Try
 java -Djava.library.path=.\plugins\ncsa.hdf\resources\win\;C:\myProduct\plugins\ncsa.hdf\resources\win

Open in new window

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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of blayfk

ASKER

a_b,
      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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial