使用HDF5Form类读取.h5图像时出错

时间:2014-03-21 08:13:11

标签: java hdf5 visad

这是我的计划,

package myapp;

import java.rmi.RemoteException;
import visad.DataImpl;
import visad.VisADException;
import visad.data.hdf5.HDF5Form;
import ncsa.hdf.hdf5lib.*;

public final class hfAdapter2 

{
  String filePath;
  String path;

    public hfAdapter2() throws VisADException, RemoteException 
    {
        filePath="F:\\Devanshi\\Input\\xyz.h5";
        System.load("F:\\Devanshi\\Projects\\MyApp\\Lib\\jhdf.dll");
        System.load("F:\\Devanshi\\Projects\\MyApp\\Lib\\jhdf5.dll");

        HDF5Form h=new HDF5Form();

        DataImpl ncData=h.open(filePath);
    }


    public static void main(String[] args)
    throws RemoteException, VisADException, IOException
    {
      new hfAdapter2();
    }
}

我得到的例外是:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
ncsa.hdf.hdf5lib.H5.H5Fopen(Ljava/lang/String;II)I

    at ncsa.hdf.hdf5lib.H5.H5Fopen(Native Method)

at visad.data.hdf5.hdf5objects.HDF5File.<init>(HDF5File.java:85)

at visad.data.hdf5.HDF5FileAdapted.<init>(HDF5FileAdapted.java:70)

at visad.data.hdf5.HDF5Form.open(HDF5Form.java:102)

at myapp.hfAdapter2.<init>(hfAdapter2.java:46)

at myapp.hfAdapter2.main(hfAdapter2.java:96)

我试图通过

来解决这个问题
  1. -Dncsa.hdf.hdf5lib.H5.hdf5lib=F:\DLL\hdf5_ij_plugin\lib\win32
  2. -Djava.library.path=F:\DLL\hdf5_ij_plugin\lib\win32
  3. 还有这个:

    1. -Dncsa.hdf.hdf5lib.H5.hdf5lib=F:\DLL\hdf5_ij_plugin\lib\win32\jhdf5.lib
    2. -Djava.library.path=F:\DLL\hdf5_ij_plugin\lib\win32\jhdf5.lib

0 个答案:

没有答案