Missing Constant in HDF5Constants in HDFView 3.0.0?


Based on the this answer in a different thread by @dave.allured I wanted to try setting the library version boundaries in my Java HDF5 writer using


However, H5F_LIBVER_V18 is not defined in the version of HDF5Constants.java that comes with the binaries of HDFView3.0.0, despite being in HDF5Constants.java of HDF5\1.10.4\src\java\src\hdf\hdf5lib\.

Am I missing something here? Shouldn’t HDF5Constants.H5F_LIBVER_V18 and HDF5Constants.H5F_LIBVER_V110 be accessible from the HDFView.jar library that comes with HDFView3.0.0?

By the way, there is a constant H5File.LIBVER_V18 according to the API.


Also, when I set


I still get a HDF5 1.10.X file:

System.out.println("test: " + file.getLibversion());


test: HDF5 1.10.1

I would expect that to be 1.8.X.


HDF5Constants.H5F_LIBVER_* are from the hdf5 java library, which would need to be imported.
HDFView imports those constants into H5File as H5File.LIBVER_*.



Hello @byrn, could you tell me explicitely what I have to import? My current setting is import:

  • HDFView.jar
  • slf4j-simple-1.7.5.jar

and setting -Djava.library.path="[MYPATH]\HDF_Group\HDFView\3.0.0\lib\". This way, I do find


but not


For the latter two, I get Cannot find symbol.


The constants are imported into the hdf/object/H5/H5File class (you could just use the object library if you don’t need the visual classes from HDFView) as follows:
public static final int LIBVER_LATEST = HDF5Constants.H5F_LIBVER_LATEST;
public static final int LIBVER_EARLIEST = HDF5Constants.H5F_LIBVER_EARLIEST;
public static final int LIBVER_V18 = HDF5Constants.H5F_LIBVER_V18;
public static final int LIBVER_V110 = HDF5Constants.H5F_LIBVER_V110;

NOTE that all four constants are available in HDF5Constants from the hdf5 library jar file:
public static final int H5F_LIBVER_ERROR = H5F_LIBVER_ERROR();
public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST();
public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18();
public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110();
public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS();
public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST();

These lines are from the released versions of HDFView3.0 (hdfoject.jar or HDFView.jar) and 1.10.4 (jarhdf5-1.10.4.jar).

I would double check paths and env settings, because everything I checked here indicates the constants should be available for you.