java.lang.UnsatisfiedLinkError:java.library.path中没有jhdf5

时间:2017-02-09 13:40:16

标签: java scala hdf5 saddle

运行保存和加载h5文件的Scala Saddle 1.3.4应用程序时出现上述错误。

我已经尝试过没有成功配置以下(Win64):

  • -Djava.library.path=C:\Dev\Tools\HDF5\1.10.0\lib\
  • -Djava.library.path=C:\Dev\Tools\HDF5\1.10.0\lib\jarhdf5-1.10.0.jar
  • -Dnative.libpath.jhdf5=C:\Dev\Tools\HDF5\1.10.0\lib\hdf5_java.dll
  • -Dnative.libpath=C:\Dev\Tools\HDF5\1.10.0\lib\

以及其他一些替代方案,但我仍然得到堆栈跟踪:

java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at ncsa.hdf.hdf5lib.H5.loadH5Lib(H5.java:347)
    at ncsa.hdf.hdf5lib.H5.<clinit>(H5.java:274)
    at ncsa.hdf.hdf5lib.HDF5Constants.<clinit>(HDF5Constants.java:28)
    at org.saddle.io.H5Store$$anonfun$createFile$1.apply$mcI$sp(H5Store.scala:291)
    at org.saddle.io.H5Store$$anonfun$createFile$1.apply(H5Store.scala:290)
    at org.saddle.io.H5Store$$anonfun$createFile$1.apply(H5Store.scala:290)
    at org.saddle.io.H5Store$.org$saddle$io$H5Store$$withMonitor(H5Store.scala:49)
    at org.saddle.io.H5Store$.createFile(H5Store.scala:290)
    at org.saddle.io.H5Store$.org$saddle$io$H5Store$$writePandasFrame(H5Store.scala:1029)
    at org.saddle.io.H5Store$$anonfun$writeFrame$1.apply$mcI$sp(H5Store.scala:210)
    at org.saddle.io.H5Store$$anonfun$writeFrame$1.apply(H5Store.scala:210)
    at org.saddle.io.H5Store$$anonfun$writeFrame$1.apply(H5Store.scala:210)
    at org.saddle.io.H5Store$.org$saddle$io$H5Store$$withMonitor(H5Store.scala:49)
    at org.saddle.io.H5Store$.writeFrame(H5Store.scala:209)
    at org.saddle.io.H5Implicits$$anon$1.writeHdfFile(H5Implicits.scala:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.juliusbaer.example.Main$.main(Main.scala:30)
    at com.juliusbaer.example.Main.main(Main.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Exception in thread "main" java.lang.UnsatisfiedLinkError: ncsa.hdf.hdf5lib.H5.H5dont_atexit()I
    at ncsa.hdf.hdf5lib.H5.H5dont_atexit(Native Method)
    at ncsa.hdf.hdf5lib.H5.loadH5Lib(H5.java:365)
    at ncsa.hdf.hdf5lib.H5.<clinit>(H5.java:274)
    at ncsa.hdf.hdf5lib.HDF5Constants.<clinit>(HDF5Constants.java:28)
    at org.saddle.io.H5Store$$anonfun$createFile$1.apply$mcI$sp(H5Store.scala:291)
    at org.saddle.io.H5Store$$anonfun$createFile$1.apply(H5Store.scala:290)
    at org.saddle.io.H5Store$$anonfun$createFile$1.apply(H5Store.scala:290)
    at org.saddle.io.H5Store$.org$saddle$io$H5Store$$withMonitor(H5Store.scala:49)
    at org.saddle.io.H5Store$.createFile(H5Store.scala:290)
    at org.saddle.io.H5Store$.org$saddle$io$H5Store$$writePandasFrame(H5Store.scala:1029)
    at org.saddle.io.H5Store$$anonfun$writeFrame$1.apply$mcI$sp(H5Store.scala:210)
    at org.saddle.io.H5Store$$anonfun$writeFrame$1.apply(H5Store.scala:210)
    at org.saddle.io.H5Store$$anonfun$writeFrame$1.apply(H5Store.scala:210)
    at org.saddle.io.H5Store$.org$saddle$io$H5Store$$withMonitor(H5Store.scala:49)
    at org.saddle.io.H5Store$.writeFrame(H5Store.scala:209)
    at org.saddle.io.H5Implicits$$anon$1.writeHdfFile(H5Implicits.scala:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.juliusbaer.example.Main$.main(Main.scala:30)
    at com.juliusbaer.example.Main.main(Main.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

1 个答案:

答案 0 :(得分:1)

我在 Windows 操作系统上启动二进制文件时遇到了同样的问题。启动 HDFView.exe 后会弹出一个命令窗口,然后再次关闭。

通过 CLI 启动后,我看到了您提到的错误:

java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path

我从上面用@kaladin anwser 解决了这个问题:我将路径 <path to app>/HDFViewApp-3.1.2-win10_64-vs16\HDFView\app\bin 添加到 PATH 系统环境变量中。保存后,我重新启动了 EXE 文件,它直接按预期工作了!