这是我的计划,
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)
我试图通过
来解决这个问题-Dncsa.hdf.hdf5lib.H5.hdf5lib=F:\DLL\hdf5_ij_plugin\lib\win32
-Djava.library.path=F:\DLL\hdf5_ij_plugin\lib\win32
还有这个:
-Dncsa.hdf.hdf5lib.H5.hdf5lib=F:\DLL\hdf5_ij_plugin\lib\win32\jhdf5.lib
-Djava.library.path=F:\DLL\hdf5_ij_plugin\lib\win32\jhdf5.lib