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

Hi,

I get this error trying to load HDF5 from Java:

java.lang.UnsatisfiedLinkError: no hdf5_java in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2458)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916)
        at java.base/java.lang.System.loadLibrary(System.java:2059)
        at hdf.hdf5lib.H5.loadH5Lib(H5.java:362)
        at hdf.hdf5lib.H5.<clinit>(H5.java:297)

Issue #1: The funny thing is that it works when I try to load the library on a AWS VM running Ubuntu but fails when I try to do the same thing on Windows running WSL. In both cases I am using same Linux binary distribution hdf5-1.14.1-2-Std-ubuntu2004_64-Intel.tar.gz.

Issue #2: Another funny thing is that when it works, I don’t actually set the java.library.path system property. What I do set is the JAVA_LIBRARY_PATH environment variable.

What gives? Can someone point me to the source code of the Java package hdf.hdf5lib.H5?

I have not tried WSL and our binaries. Not knowing the WSL/Windows system, I can’t say for sure what the problem is. However, when I have encountered the issue in the past I had to make sure that PATH type env vars were set properly (LD_LIBRARY_PATH on linux, PATH on windows)