error: when starting hdfview on ubuntu18.04


#1

Hello! I am new to hdfview and got errors when I tried to install and start it on my ubuntu18.04.
I installed it using the commands following:
sudo apt-get install alien
cd ~/Downloads
wget https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.1.2/bin/HDFView-3.1.2-centos7_64.tar.gz
mkdir HDFView
cp HDFView-3.1.2-centos7_64.tar.gz HDFView/HDFView-3.1.2-centos7_64.tar.gz
cd HDFView/
tar xfvz HDFView-3.1.2-centos7_64.tar.gz
sudo alien --scripts hdfview-3.1.2-1.x86_64.rpm
sudo dpkg -i hdfview_3.1.2-2_amd64.deb

Then when I tried to start hdfview, it prompts:
cd /opt/hdfview/
sudo ./bin/HDFView

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:///opt/hdfview/lib/app/mods/slf4j-nop-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hdfview/lib/app/extra/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hdfview/lib/app/slf4j-nop-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
No protocol specified
Unable to init server: Could not connect: Connection refused
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at swt/org.eclipse.swt.SWT.error(SWT.java:4749)
at swt/org.eclipse.swt.widgets.Display.createDisplay(Display.java:1130)
at swt/org.eclipse.swt.widgets.Display.create(Display.java:1070)
at swt/org.eclipse.swt.graphics.Device.<init>(Device.java:175)
at swt/org.eclipse.swt.widgets.Display.<init>(Display.java:636)
at swt/org.eclipse.swt.widgets.Display.<init>(Display.java:627)
at hdf.view.HDFView.main(HDFView.java:2459)
Failed to launch JVM

I searched online and found relevant issues here:https://stackoverflow.com/questions/65337254/build-hdfview-3-1-on-ubuntu-20-04
but when I tried to fix this following the solutions in this site, it prompts:
sudo apt install openjdk-15-jre
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package openjdk-15-jre
my java version:
java -version
openjdk version “11.0.13” 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.18.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.18.04, mixed mode, sharing)

I cannot find solutions on other websites. Could anyone help me fix this?Thanks in advance.


#2

Unfortunately we cannot support all versions of platforms but do try to support 2-3 versions active at the time of release. We did release on ubuntu 20.04 and 20.10. I imagine the issue is the version of gtk available and the version of the gtk required by swt library. 2nd choice would be to build it from source and be sure you have the correct swt library. This is available with the eclipse project.
HDFView 3.1.3 build does require the packager available starting within openjdk-15. Note that it needs to be the jdk and not the jre.


#3

Thank you for your reply.
So if I want to install an arbitrary version of HDFView on my ubuntu18.04, could you tell me if this is feasible? If yes, could you tell me which version I should install and how to install it?
Thanks a lot.