I'm using Matlab version R2013b on Linux Ubuntu 12.04 and have a Matlab application that depends on the Java HDF5 the one from HDFGROUP. My problem is that the JHDF5 wrapper composed of the two files jhdf5.jar
and libjhdf5.so
seems to be in some form incompatible with the HDF5 library integrated within Matlab.
My environment is setup as follows i.e. to ensure a version of JAVA within Matlab:
$ env | grep JAVA
MATLAB_JAVA=/opt/dev/java/1.7.0_55/jre
JAVA_HOME=/opt/dev/java/1.7.0_55
JAVA_VERSION=1.7.0_55
I start Matlab from a directory where I set the following two files to setup the JHDF5 library:
java.opts
-XX:MaxPermSize=256m
-Xmx4091m
-Xms2048m
-Dncsa.hdf.hdf5lib.H5.hdf5lib=/opt/dev/jhdf5/2.7/lib/linux/libjhdf5.so
javaclasspath.txt
/opt/dev/jhdf5/2.7/lib/jhdf5.jar
...
From within Matlab I get the following (meaning I have HDF5 version 1.8.6 and all the rest i.e. JRE and JHDF5 setup as required):
>> [maj,min,relnum] = H5.get_libversion
maj =
1
min =
8
relnum =
6
>> java.lang.System.getProperty('ncsa.hdf.hdf5lib.H5.hdf5lib')
ans =
/opt/dev/jhdf5/2.7/lib/linux/libjhdf5.so
>> version -java
ans =
Java 1.7.0_55-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
but then when I try to run a simple command e.g. create an instance of ncsa.hdf.hdf5lib.H5
or simply access it from the Matlab command line, Matlab crashes
>> ncsa.hdf.hdf5lib.H5 % crashes Matlab
I some times see the following error popping out in the console:
HDF5-DIAG: Error detected in HDF5 (1.8.6) thread 0:
#000: H5Edeprec.c line 186 in H5Eget_minor(): not a error message ID
major: Invalid arguments to routine
minor: Inappropriate type
To recap I have the following versions:
- Java JDK 1.7.0_55
- Matlab R2013b
- HDF5 native library version 1.8.6
- JHDF5 wrapper library version 2.7 that is compatible with HDF5 native 1.8.6. See the compatibility note here RELEASE.txt