I am learning HDF5 with jhdf5.
I am working on MAC OS_X.
This installs hdf5-1.10 in /usr/local/Cellar/hdf5
https://support.hdfgroup.org/ftp/HDF5/hdf-java/hdf-java-examples/jnative/h5/HDF5FileCreate.java
This is the most basic java example file.
Add this dependency in gradle
compile group: 'org.hdfgroup', name: 'hdf-java', version: '2.6.1'
Update package import statements by adding ncsa in front.
Run it. And I got this error java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path
This is expected because jhdf5 according to my knowledge is just a wrapper calling native functions.
So I need to add something to ncsa.hdf.hdf5lib.H5.hdf5lib in the system setting.
I am not sure which library to add and where to find them.
I found a few examples online but all are in Windows, hence, the names are and paths are not really similar.
I found it after trying a few times.
Go to https://support.hdfgroup.org/products/java/release/cmakebuild.html and install CMake-hdfjava-.
NOTE: might need to install CMake if it is not done before.
After installing it (by running the script), go to build directory. Unzip the zip file mentioned in the webpage.
add this when running the java file from IDEs, example:
-Djava.library.path=/Users/wphyo/Projects/LSMD/CMake-hdfjava-3.3.2/build/HDFJava-3.3.2-Darwin/HDF_Group/HDFJava/3.3.2/lib
Alternatively, we can also use the shell script provided in the web page to run too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With