[Hdf-forum] Reading an HDF5 file in Java

2013-05-14 Thread Marko Kurm
I'm trying to open/read an existing HDF5 file using the Java library. I
have the jhdf.dll and jhdf5.dll files on the system path. The code I
have in my main method is taken from the HDF samples, and looks like this:

H5File h5file = new
H5File(C:\\dev\\workspaces\\hdf5\\hdf5\\src\\main\\java\\com\\vaisala\\hdf5\\hdf5_test.h5,
HDF5Constants.H5F_ACC_RDONLY);

try
{
// open file and retrieve the file structure
h5file.open();
}
catch (Exception ex)
{
System.out.println(ex);
}

When I run it, it throws the following exception:

Exception in thread main java.lang.UnsatisfiedLinkError:
ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(ILjava/lang/String;[Ljava/lang/String;[I[JI)I
at ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(Native Method)
at ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(H5.java:4588)
at ncsa.hdf.object.h5.H5File.depth_first(H5File.java:1617)
at ncsa.hdf.object.h5.H5File.loadTree(H5File.java:1554)
at ncsa.hdf.object.h5.H5File.open(H5File.java:1520)
at ncsa.hdf.object.h5.H5File.open(H5File.java:1464)
at ncsa.hdf.object.h5.H5File.open(H5File.java:825)
at com.vaisala.hdf5.TestH5File.main(TestH5File.java:24)

Any ideas what could be wrong?

Marko Kurm
___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] Reading an HDF5 file in Java

2013-05-16 Thread Marko Kurm
Sorry, the formatting didn't work. Here it is again:


I have the DLL files in the system path + I added the following arguments
to the run configuration:

-Djava.library.path=C:/dev/hdf5/hdf-java/lib/win
-Dncsa.hdf.hdf5lib.H5.hdf5lib=C:/dev/hdf5/hdf-java/lib/win/jhdf5.dll

and inside C:/dev/hdf5/hdf-java/lib/win folder, I have two files: jhdf5.dll
 jhdf.dll. At first I had the problem that the DLL-s where not on the
path, but in that case, it throws a java.lang.UnsatisfiedLinkError: no
jhdf5 in java.library.path exception so this is not the case. Anyway, I
still get the same error message: Exception in thread main
java.lang.UnsatisfiedLinkError:
ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(ILjava/lang/
String;[Ljava/lang/String;[I[JI)I

I took a look inside the DLL-s (with DLL Export
Viewerhttp://www.nirsoft.net/utils/dll_export_viewer.html)
to see what functions they export and I didn't see the
H5Gget_obj_info_all function there. Maybe I'm missing some DLL? I only
have the two that came with downloading this
filehttp://www.hdfgroup.org/ftp/HDF5/hdf-java/bin/win64/hdf-java-2.9-bin.tar
What
kind of HDF DLL-s do you have on your paths?


2013/5/16 marko.kurm marko.k...@gmail.com

 Thanks for the help guys! I have the DLL files in the system path + I
 added the following arguments to the run configuration:
 -Djava.library.path=C:/dev/hdf5/hdf-java/lib/win
 -Dncsa.hdf.hdf5lib.H5.hdf5lib=C:/dev/hdf5/hdf-java/lib/win/jhdf5.dll and
 inside C:/dev/hdf5/hdf-java/lib/win folder, I have two files: jhdf5.dll 
 jhdf.dll. At first I had the problem that the DLL-s where not on the path,
 but in that case, it throws a java.lang.UnsatisfiedLinkError: no jhdf5 in
 java.library.path exception so this is not the case. Anyway, I still get
 the same error message: Exception in thread main
 java.lang.UnsatisfiedLinkError:
 ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(ILjava/lang/String;[Ljava/lang/String;[I[JI)I
 I took a look inside the DLL-s (with DLL Export 
 Viewerhttp://www.nirsoft.net/utils/dll_export_viewer.html)
 to see what functions they export and I didn't see the
 H5Gget_obj_info_all function there. Maybe I'm missing some DLL? I only
 have the two that came with downloading this 
 filehttp://www.hdfgroup.org/ftp/HDF5/hdf-java/bin/win64/hdf-java-2.9-bin.tarWhat
  kind of HDF DLL-s do you have on your paths?
 --
 View this message in context: Re: Reading an HDF5 file in 
 Javahttp://hdf-forum.184993.n3.nabble.com/Reading-an-HDF5-file-in-Java-tp4026180p4026189.html
 Sent from the hdf-forum mailing list 
 archivehttp://hdf-forum.184993.n3.nabble.com/at Nabble.com.

 ___
 Hdf-forum is for HDF software users discussion.
 Hdf-forum@hdfgroup.org
 http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org