# Installing HDFView on Linux

**URL:** <https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817>\
**Category:** HDFView / Java HDF Object Package\
**Created:** [December 1, 2020, 10:59am UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817 "2020-12-01T10:59:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![thibault.vaillantdeg](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thibault.vaillantdeg](https://forum.hdfgroup.org/u/thibault.vaillantdeg)\
**Post date:** [December 1, 2020, 10:59am UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/1 "2020-12-01T10:59:18Z")

</div>

Hello,

I’ve tried to install HDFView on my Linux Ubuntu 20.04 laptop and I found HDFView on the official repositories:

> `:~$ sudo apt-cache show hdfview`  
> `Package: hdfview`  
> `Architecture: amd64`  
> `Version: 2.11.0+dfsg-3ubuntu2`  
> `Priority: optional`  
> `Section: universe/libs`  
> `Source: jhdf`  
> `Origin: Ubuntu`  
> `Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>`  
> `Original-Maintainer: Debian Science Team <`[debian-science-maintainers@lists.alioth.debian.org](mailto:debian-science-maintainers@lists.alioth.debian.org)\>  
> `Bugs: https://bugs.launchpad.net/ubuntu/+filebug`  
> `Installed-Size: 516`  
> `Depends: libjgraph-java, libjhdf5-java, libjhdf4-java, libslf4j-java, java-wrappers, `default-jre  
> `Suggests: www-browser`  
> `Filename: pool/universe/j/jhdf/hdfview_2.11.0+dfsg-3ubuntu2_amd64.deb`  
> `Size: 442848`  
> `MD5sum: d4ac897eb747a3b1d7aab9f0a2684537`  
> `SHA1: b1a1a77e243a97ef64ac24bd25cdebb3f6fe3821`  
> `SHA256: e3a1c07450688c4958840c304d640ffc09262a5899126993ae0e022e5af0bd9c`  
> `Homepage: http://www.hdfgroup.org/hdf-java-html/`  
> `Description-en: Java HDF Object viewer`  
> ` HDF is a versatile data model that can represent very complex data objects`  
> ` and a wide variety of metadata. It is a completely portable file format`  
> ` with no limit on the number or size of data objects in the collection.`  
> ` .`  
> ` This package provides a HDF4/HDF5 viewer.`  
> `Description-md5: 4b9ccbb5f76814f27025f1f65e5b4fbf`

I’ve installed this package but when trying to start it, I get this error:

> `:~$ hdfview`  
> `/usr/bin/hdfview: 304: exec: /usr/lib/jvm/java-8-oracle/bin/java: not found`

I’ve read the installation steps on this website: [https://portal.hdfgroup.org/display/HDFVIEW/HDFView#HDFView-install](https://portal.hdfgroup.org/display/HDFVIEW/HDFView#HDFView-install). It seems there is something to do with the environment variables. However, this information is not meaningful enough for my poor IT skills.

It seems that the package version (2.11.0) available on the official repositories is quite old. Then, it is maybe not the best way to install it.

Could you please let me know how should I install HDFView?

Many thanks for your help! 🙂

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [December 15, 2020, 5:57pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/2 "2020-12-15T17:57:46Z")

</div>

HDF just released a new HDFView 3.1.2. Check the [hdfgroup.org](http://hdfgroup.org) website.

Allen

---

<div class="post-metadata">

**Author:** ![fire2dev](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/f/49beb7/32.png) [@fire2dev](https://forum.hdfgroup.org/u/fire2dev)\
**Post date:** [February 5, 2021, 8:52pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/3 "2021-02-05T20:52:14Z")

</div>

after a lot of search and changing machine. I was able to install hdf5view in my system(Ubuntu 20.10 ).  
steps:

1. Download the first centos tar file from here [HDFView-3.1.2-centos7\_64.tar.gz](https://www.hdfgroup.org/downloads/hdfview/) .

2. install “alien (sudo apt install alien)” tool to convert the rpm file into executable file for ubuntu.

2.a `sudo alien -i your-downloaded-and-uncompressed-rpm-file`

1. After conversion the file in my case was present in /opt/hdfview/ directory and so I went there.

2. Last step was execute the file with `sudo /opt/hdfview/HDFView` .

---

<div class="post-metadata">

**Author:** ![thibault.vaillantdeg](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thibault.vaillantdeg](https://forum.hdfgroup.org/u/thibault.vaillantdeg)\
**Post date:** [February 8, 2021, 11:21am UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/4 "2021-02-08T11:21:09Z")

</div>

Thanks! I managed to install HDFView following your instructions. However, I have difficulties to open HDF file. If I try to open a HDF file with HDFView (right click + “Open With HDFView”), I got the following error message on the bottom of the app:

> ```
> HDFView root - /home/thibault
> User property file - /home/thibault/.hdfview3.1.2
> ***Unable to open file '/home/thibault/Desktop/CAL_LID_L2_05kmCLay-Standard-V4-20.2010-08-05T23-40-14ZN.hdf': HDF4 library linking error*** 
> ***java.io.IOException: Unsupported fileformat - /home/thibault/Desktop/CAL_LID_L2_05kmCLay-Standard-V4-20.2010-08-05T23-40-14ZN.hdf*** 
> 
> ```

If I open first the app and then open a file from the app, the app closes and I get the following error message in the terminal:

> ```
> Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class hdf.hdflib.HDFLibrary
> at hdf.object.h4.H4File.isThisType(H4File.java:207)
> at hdf.view.TreeView.DefaultTreeView.openFile(DefaultTreeView.java:2348)
> at hdf.view.HDFView.openLocalFile(HDFView.java:1812)
> at hdf.view.HDFView$26.widgetSelected(HDFView.java:973)
> at swt/org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
> at swt/org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
> at swt/org.eclipse.swt.widgets.Display.sendEvent(Display.java:5685)
> at swt/org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
> at swt/org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4953)
> at swt/org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4446)
> at hdf.view.HDFView.runMainWindow(HDFView.java:378)
> at hdf.view.HDFView$39.run(HDFView.java:2572)
> at swt/org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
> at swt/org.eclipse.swt.widgets.Display.syncExec(Display.java:5795)
> at hdf.view.HDFView.main(HDFView.java:2563)
> Failed to launch JVM
> 
> ```

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [February 8, 2021, 12:47pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/5 "2021-02-08T12:47:44Z")

</div>

If this is an ubuntu machine, HDF has an ubuntu 20.10 based release file. Send a message to [help@hdfgroup.org](mailto:help@hdfgroup.org).  
The error indicates a failure with the hdf4 library stack. Have you tried an hdf5 file to determine if it is only a hdf4 problem?

Allen

---

<div class="post-metadata">

**Author:** ![thibault.vaillantdeg](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thibault.vaillantdeg](https://forum.hdfgroup.org/u/thibault.vaillantdeg)\
**Post date:** [February 8, 2021, 1:05pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/6 "2021-02-08T13:05:15Z")

</div>

I’m not sure I have any hdf5 file handy…  
I’m using Ubuntu 20.04. Is the 20.10 based release expected to work on 20.04?

---

<div class="post-metadata">

**Author:** ![gnwiii](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@gnwiii](https://forum.hdfgroup.org/u/gnwiii)\
**Post date:** [February 8, 2021, 1:51pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/7 "2021-02-08T13:51:36Z")

</div>

> [@thibault.vaillantdeg](#):
>
> Could not initialize class hdf.hdflib.HDFLibrary at hdf.object.h4.H4File.isThisType(H4File.java:207)

This could mean your system lacks a supporting library. The `ldd` program is used to list the libraries required by a program or `.so` library. My fedora 33 system (which so far is used only with NtCDF4 files) shows:

```auto
$ cd /opt/hdfview/lib/app
$ ldd libmfhdf.so.4
ldd: warning: you do not have execution permission for `./libmfhdf.so.4'
        linux-vdso.so.1 (0x00007fff2b7e8000)
        libxdr.so.4 => not found
        libhdf.so.4 => /opt/hdfview/lib/app/./libhdf.so.4 (0x00007fb82381a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb82364f000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fb823509000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fb823502000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb823d8c000)

```

---

<div class="post-metadata">

**Author:** ![thibault.vaillantdeg](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thibault.vaillantdeg](https://forum.hdfgroup.org/u/thibault.vaillantdeg)\
**Post date:** [February 8, 2021, 2:07pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/8 "2021-02-08T14:07:28Z")

</div>

It seems that I get something similar:

> ```
> $ ldd libmfhdf.so.4
> linux-vdso.so.1 (0x00007ffcc9cb9000)
> libxdr.so.4 => not found
> libhdf.so.4 => /opt/hdfview/lib/app/./libhdf.so.4 (0x00007f08d24c9000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f08d22d7000)
> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f08d2188000)
> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f08d2182000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f08d2a30000)
> 
> ```

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [February 8, 2021, 2:28pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/9 "2021-02-08T14:28:38Z")

</div>

libxdr.so.4 =\> not found

That file is from hdf4 distribution, which somehow did not get in the packaging. It is available from the hdf4 binary, which should be on the website, else ask for the ubuntu version from [help@hdfgroup.org](mailto:help@hdfgroup.org).

Allen

---

<div class="post-metadata">

**Author:** ![gnwiii](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@gnwiii](https://forum.hdfgroup.org/u/gnwiii)\
**Post date:** [February 8, 2021, 5:06pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/10 "2021-02-08T17:06:28Z")

</div>

I downloaded `hdf-4.2.15-linux-centos7-x86_64-shared.tar.gz`, but it does not contain `libxdr.so.4`.

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [February 8, 2021, 5:39pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/11 "2021-02-08T17:39:09Z")

</div>

okay, strange, I just checked a hdf4 build and an ldd of libmfhdf.so and there was no libxdr in the list.  
Can you check ldd of libmfhdf.so on that hdf4 binary?

Allen

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [February 8, 2021, 5:49pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/12 "2021-02-08T17:49:52Z")

</div>

Then if ldd on hdf4 doesn’t show libxdr, try copying the hdf4 so files over the hdfview so files.

Allen

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [February 8, 2021, 5:51pm UTC](https://forum.hdfgroup.org/t/installing-hdfview-on-linux/7817/13 "2021-02-08T17:51:30Z")

</div>

Note that the so.4 files are symlinks in hdf4, I just copied over the so.4.2.15 file and renamed it to so.4

Allen
