软硬件环境
- windows 10 64bit
- HDFView 3.1.2
问题
HDFView
是 h5
文件的可视化工具,可是安装后发现就是打不开,一直闪退
解决方法
从下载包中看到了一个 readme.txt
文件,打开后
HDFView 3.1.2
------------------------------------------------------------------------------
This directory contains the binary (release) distribution of
HDFView 3.1.2 that was compiled on:
Windows win-amd64
with: Java JDK 15.0.1
It was built with the following options:
-- SHARED HDF 4.2.15
-- SHARED HDF5 1.10.7
看到了 JDK
,难道需要 java
的运行环境?好吧,先试试看,然后就去 oracle
下载了 jre
,安装后,环境变量也设置了,发现还是打开不,闪退。
后来,来到官方论坛搜了搜,发现官方的已知问题列表里,已经有这个问题及其解决方案了。这里他们提供了对应的2个脚本,windows
下的 hdfview.bat
和 unix
下的 hdfview.sh
,链接是: https://portal.hdfgroup.org/display/support/HDFView+3.1.2#HDFView3.1.2-knownprobs>
这里看看 windows
下的 bat
文件
@ECHO OFF
rem File Name: hdfview.bat
rem This batch file is used to execute the hdfview utility
rem ... hdfview.root property is for the install location
rem ...... default location is system property user.dir
rem ... hdfview.workdir property is for the working location to find files
rem ...... default location is system property user.home
rem
setlocal enabledelayedexpansion
pushd %~dp0
rem Adjust the following variable to match your environment
set INSTALLDIR=%cd%
set PATH=%INSTALLDIR%\app;%PATH%
set JAVABIN=%INSTALLDIR%\runtime\bin
rem start "HDFView" "%JAVABIN%\javaw.exe" %JAVAOPTS% -Xmx1024M -Djava.library.path="%INSTALLDIR%\app" -Dhdfview.root="%INSTALLDIR%\app" -jar "%INSTALLDIR%\app\HDFView.jar" %*
rem Default invocation when using modules
start "HDFView" "%JAVABIN%\javaw.exe" %JAVAOPTS% -Xmx1024M -Djava.library.path="%INSTALLDIR%\app;%INSTALLDIR%\app\ext" -Dhdfview.root="%INSTALLDIR%\app" -cp "%INSTALLDIR%\app\*" hdf.view.HDFView %*
exit /b 0
这里需要修改 INSTALLDIR
环境变量的值,比如 HDFView
的默认安装路径是 C:\Users\admin\AppData\Local\HDF_Group\HDFView
,保存后就可以双击运行了
set INSTALLDIR=C:\Users\admin\AppData\Local\HDF_Group\HDFView