# Building HDFView 3.1.2 on Ubuntu 20.04

**URL:** <https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906>\
**Category:** HDFView / Java HDF Object Package\
**Created:** [December 21, 2020, 2:23pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906 "2020-12-21T14:23:32Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranto.roza.53](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pranto.roza.53](https://forum.hdfgroup.org/u/pranto.roza.53)\
**Post date:** [December 21, 2020, 2:23pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/1 "2020-12-21T14:23:32Z")

</div>

Hi,

I’ve tried to install `HDFView 3.1.2` on my Linux Ubuntu 20.04 laptop and I have downloaded HDFView pre-build binary file from [HDFView-3.1.2-ubuntu20\_64.tar.gz](https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.1.2/bin/) link.

I didn’t see any error during installation. But it didn’t open at all.

![hdfview](https://hdf-discourse-1.s3.amazonaws.com/original/2X/f/f81ec42e956951da4bebfbe9fc6f18ecba9ef649.png).

possible reasons for that maybe it compiled with `5.4.0-52-generic`. I am using

```bash
java-1.11.0-openjdk 
hdf5-1.10
5.4.0-58-generic

```

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

---

<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:** [December 21, 2020, 6:07pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/2 "2020-12-21T18:07:02Z")

</div>

I can confirm that the binary doesn’t run on Ubuntu 20.04 LTS:

```auto
 % /opt/hdfview/bin/HDFView
Error: dl failure on line 534
Error: failed /opt/hdfview/lib/runtime/lib/server/libjvm.so, because /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /opt/hdfview/lib/runtime/lib/server/libjvm.so)
Failed to launch JVM

```

Google will show that many people using Ubuntu 20.04 LTS (focal fossa) are having problems with 3rd party applications that require `GLIBC_2.32'. Ubuntu focal has`GLIBC\_2.31’. Upgrading to 20.10 should provide `GLIBC\_2.32’ along with the 5.8 kernel (as mentioned in the README file).

---

<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 21, 2020, 6:56pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/3 "2020-12-21T18:56:07Z")

</div>

Yes it was compiled on ubuntu 20.10. The release.txt file in the binary should indicate that exact versions.

Allen

---

<div class="post-metadata">

**Author:** ![pranto.roza.53](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pranto.roza.53](https://forum.hdfgroup.org/u/pranto.roza.53)\
**Post date:** [December 22, 2020, 9:33am UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/4 "2020-12-22T09:33:47Z")

</div>

I solved the previous problem.

Now If I want to do it from the source code, How am I supposed to do it? I have added

```auto
hdf.lib.dir = /home/pranto/opt/hdf-4.2.15_root_install/lib
hdf5.lib.dir = /home/pranto/opt/hdf5_1.10.7_root_install/lib

```

lines in the `build.properties` file. When I run `ant run`, I got the following error

```bash
create-property-file:
[propertyfile] Creating new property file: /home/pranto/Downloads/hdfview-3.1.2/build/classes/hdf/versions.properties

compileobj:
     [copy] Copied 2 empty directories to 2 empty directories under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilehdf4:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilefits:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilenc2:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilehdf5:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compile:
    [javac] Compiling 98 source files to /home/pranto/Downloads/hdfview-3.1.2/build/classes
    [javac] javac: invalid flag: --module-source-path
    [javac] Usage: javac <options> <source files>
    [javac] use -help for a list of possible options

BUILD FAILED
/home/pranto/Downloads/hdfview-3.1.2/build.xml:340: Compile failed; see the compiler error output for details.

Total time: 2 seconds

```

---

<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 22, 2020, 2:02pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/5 "2020-12-22T14:02:45Z")

</div>

modules require JDK-15 and at least ant-1.10. We use the latest OpenJDK-15 and ant 1.10.5.

Allen

---

<div class="post-metadata">

**Author:** ![pranto.roza.53](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pranto.roza.53](https://forum.hdfgroup.org/u/pranto.roza.53)\
**Post date:** [December 22, 2020, 2:56pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/6 "2020-12-22T14:56:25Z")

</div>

Hi,

I got the following error while compiling from the source file of `hdf5-1.10.7` and got the same error also with `hdf5-1.12`

```bash
./configure --enable-shared \
--enable-cxx --enable-fortran --with-szlib --enable-build-mode=debug \
--enable-java --prefix=$HOME/opt/hdf5_1.10.7_root_instal

            SUMMARY OF THE HDF5 CONFIGURATION
	    =================================
       AM C++ Flags: 
             Shared C++ Library: yes
             Static C++ Library: yes

                           Java: yes
                  Java Compiler: /usr/bin/java (openjdk 11.0.9.1 2020-11-04)

make[1]: Entering directory '/home/pranto/opt/hdf5-1.10.7/java'
Making all in src
make[2]: Entering directory '/home/pranto/opt/hdf5-1.10.7/java/src'
Making all in jni
make[3]: Entering directory '/home/pranto/opt/hdf5-1.10.7/java/src/jni'
  CC exceptionImp.lo
exceptionImp.c:32:10: fatal error: jni.h: No such file or directory
   32 | #include "jni.h"
      | ^ ~~~~~~
compilation terminated.
make[3]: *** [Makefile:948: exceptionImp.lo] Error 1
make[3]: Leaving directory '/home/pranto/opt/hdf5-1.10.7/java/src/jni'
make[2]: *** [Makefile:763: all-recursive] Error 1
make[2]: Leaving directory '/home/pranto/opt/hdf5-1.10.7/java/src'
make[1]: *** [Makefile:828: all-recursive] Error 1
make[1]: Leaving directory '/home/pranto/opt/hdf5-1.10.7/java'
make: *** [Makefile:669: all-recursive] Error 1

```

How to solve this problem?

---

<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:** [December 22, 2020, 4:51pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/7 "2020-12-22T16:51:28Z")

</div>

```auto
exceptionImp.c:32:10: fatal error: jni.h: No such file or directory
   32 | #include "jni.h"
      | ^ ~~~~~~

```

The `jni.h` file is provided by the jdk. Do you have `/usr/lib/jvm/java-11-openjdk-amd64/include/jni.h`? If not, you need to install the `openjdk-11-jdk` package.  
If you have `jni.h` then some investigation is needed to determine why is isn’t found.

PS: You mentioned that you had solved the previous problem, but it isn’t clear  
which problem or how you solved it. In my experience, for each person who writes  
about a problem there are many others watching for the solution, so it is very helpful if the forum provides a complete record

---

<div class="post-metadata">

**Author:** ![derobins](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/derobins/32/1481_2.png) [@derobins](https://forum.hdfgroup.org/u/derobins)\
**Post date:** [December 22, 2020, 8:44pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/8 "2020-12-22T20:44:01Z")

</div>

The “can’t find jni.h” issue sounds like a problem we recently fixed in the develop branch. Try copying develop’s autotools jni file to the m4 directory in your unpacked source.

> <https://github.com/HDFGroup/hdf5/blob/develop/m4/ax_jni_include_dir.m4>

---

<div class="post-metadata">

**Author:** ![pranto.roza.53](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pranto.roza.53](https://forum.hdfgroup.org/u/pranto.roza.53)\
**Post date:** [December 23, 2020, 9:22am UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/9 "2020-12-23T09:22:59Z")

</div>

> The jni.h file is provided by the jdk. Do you have /usr/lib/jvm/java-11-openjdk-amd64/include/jni.h?

I reinstalled `openjdk-11-jdk` and everything works fine now.

---

<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:** [January 6, 2021, 8:19pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/10 "2021-01-06T20:19:47Z")

</div>

Also, note that hdfview 3.1.2 will need at least openjdk 15, for packaging. For building hdfview you will also need a recent ant (like 10.2).

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/building-hdfview-3-1-2-on-ubuntu-20-04/7906/11 "2021-02-05T20:52:13Z")

</div>

I am having problems building it on Ubuntu 20.10. Can anybody please provide proper steps to build it succcessfully. Thanks. It is much needed for my academic project.

---

<div class="post-metadata">

**Author:** ![curty](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/c/b5ac83/32.png) [@curty](https://forum.hdfgroup.org/u/curty)\
**Post date:** [May 3, 2021, 2:33pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/12 "2021-05-03T14:33:26Z")

</div>

> HDFView (at Ubuntu 20.04 LTS)

I have just start using it after that:

$ 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](https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.1.2/bin/HDFView-3.1.2-centos7_64.tar.gz)  
$ tar xfvz HDFView-3.1.2-centos7\_64.tar.gz$ cd ~Downloads/HDFView-3.1.2-centos7\_64  
$ sudo alien --scripts hdfview-3.1.2-1.x86\_64.rpm  
$ sudo dpkg -i hdfview\_3.1.2-2\_amd64.deb

and it seems working fine… 🙂

---

<div class="post-metadata">

**Author:** ![annampp02](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@annampp02](https://forum.hdfgroup.org/u/annampp02)\
**Post date:** [August 20, 2021, 2:17am UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/13 "2021-08-20T02:17:35Z")

</div>

How did you get this to run? I did all the steps but it’s not running

---

<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:** [August 20, 2021, 7:21pm UTC](https://forum.hdfgroup.org/t/building-hdfview-3-1-2-on-ubuntu-20-04/7906/14 "2021-08-20T19:21:32Z")

</div>

The permissions set by the alien installation only allow root to use hdfview:

```auto
% cd /opt/hdfview
% ls -ld *
drwx------ 2 root root 3 Aug 20 15:48 bin
drwx------ 4 root root 7 Aug 20 15:48 lib

```

Root privileges should only be used for well-tested and trusted administrative  
tools. HDFview is nowhere close to well-tested and trusted and is not an  
administration tool – users should fix the permissions before attempting to  
use the package.

This is easily corrected by users with basic linux command-line skills, so  
is “an excercise left to the reader”. Any reader who didn’t recognize this  
problem and knows an efficient solution needs to spend a few evenings  
with [linuxcommand.org](http://linuxcommand.org) or a similar introduction to the linux command line  
until they feel confident about the management of basic file and directory  
permissions in linux. Hint: the `find` command is useful for an efficient  
solution.
