Use HDF5 Java object package to write hdf5-file in Windows - installation


#1

Hi there,

I have a Java application and from inside this application I want to write a hdf5 file. I am currently using Windows 7 64bit and Netbeans 8.2 to develop my application.

Honestly speaking, I am confused right now as there are so many versions of HDF5, HDFJava and HDFView with the Java object package available that I do not know what I have to do to get hdf5 running in my application. The different support pages for different versions increase this confusion. I would really like to use the Java object package described here to create my hdf5 file.

Now what do I have to do to get hdf5 running on my system?

  • Which HDF5 product can I use? I guess HDFView is the choice for me, am I right?
  • Do I have to create a seperate library for hdf5?
  • Do I have to link to the dll’s?

In short, is there a step-by-step guide how to use HDF5 for coding inside my IDE?

Any help is very much appreciated.


#2

Hello Raedma,

If you are using HDF5-1.10, the HDF-Java APIs are included in the HDF5 source code, and they can be built by specifying the HDF5_ENABLE_JAVA CMake option on WIndows. The pre-built HDF5-1.10.1 windows binaries include the HDF-Java APIs.

If you are using HDF5-1.8, the HDF-Java APIs are a separate distribution, and HDF-Java 3.3.2 is the latest version. You can get that from this page:

https://support.hdfgroup.org/products/java/release/download.html

This just consists of the Java wappers that interface with the HDF5 C library.

If you want the object library, it is included with the HDFView product.
For HDF5-1.10, you can get HDFView 3.x from the new support site, here:

https://portal.hdfgroup.org/display/support/Download+HDFView

If you want HDF5-1.8, you can get HDFView 2.14 from here:

https://support.hdfgroup.org/products/java/release/download.html

If you have more questions, just let us know.
Sorry for the confusion!

-Barbara
help@hdfgroup.org


#3

Hello @bljones,

thanks for the hints. I would like to use the pre-built windows binaries for HDF5-1.10.1, downloaded and installed them. I added

D:\Programs\HDF_Group\HDF5\1.10.1\bin\
D:\Programs\HDF_Group\HDF5\1.10.1\lib\

to my system path variable and also add -Djava.library.path=“D:\Programs\HDF_Group\HDF5\1.10.1\lib” to the library path of Netbeans. However, I cannot create a HDF5 file inside my Java application using this approach. If I add the *.jar files from D:\Programs\HDF_Group\HDF5\1.10.1\lib\ as a library in my project, I still can not access any of the HDF5 object package commands.

If I download and install HDFView and use the jar file D:\Programs\HDF_Group\HDFView\3.0.0\lib\HDFView.jar as a library in my application, I can use, e.g.

FileFormat fileFormat = FileFormat.getFileFormat(FileFormat.FILE_TYPE_HDF5);
H5File testFile = (H5File) fileFormat.createFile(fname, FileFormat.FILE_CREATE_DELETE);

and create and fill a HDF5 file.

Is there a tutorial on how to properly setup HDF5 and create a HDF5 file inside a Java application using just HDF5-1.10.1 somewhere?


#4

With HDFView 3.0 Beta the object package was inadvertently combined with the
HDFView.jar file. In the final release version of HDFView 3.0, it will be provided
as a separate “hdfobject.jar” file, as was done in earlier releases.