IcedTea-8 cannot run any jnlp application (maybe due to openjdk-11?)

After some trial and error I found only one useful solution - we need to install normal OpenJDK 8 from previous Ubuntu 16.04 LTS manually with commands below. It is usually not recommended, but we do not have other methods with positive result.

So the commands to install are the following (we remove existing OpenJDK and then install deb-packages manually):

sudo apt purge oracle-java11-* -y
sudo apt purge *openjdk* -y
sudo apt autoremove --purge -y

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openjdk-8/openjdk-8-jre-headless_8u272-b10-0ubuntu1~16.04_amd64.deb
sudo apt install -y ./openjdk-8-jre-headless_8u222-b10-1ubuntu1~16.04.1_amd64.deb

wget http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
sudo apt install -y ./libpng12-0_1.2.54-1ubuntu1.1_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openjdk-8/openjdk-8-jre_8u272-b10-0ubuntu1~16.04_amd64.deb
sudo apt install -y ./openjdk-8-jre_8u222-b10-1ubuntu1~16.04.1_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/universe/i/icedtea-web/icedtea-netx-common_1.6.2-3ubuntu1_all.deb
sudo apt install -y ./icedtea-netx-common_1.6.2-3ubuntu1_all.deb

wget http://archive.ubuntu.com/ubuntu/pool/universe/i/icedtea-web/icedtea-netx_1.6.2-3ubuntu1_amd64.deb
sudo apt install -y ./icedtea-netx_1.6.2-3ubuntu1_amd64.deb

Also we need to pin/hold the versions of such packages with single long command below:

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-java8
Package: icedtea-netx
Pin: version 1.6.2-3ubuntu1
Pin-Priority: 1337

Package: icedtea-netx-common
Pin: version 1.6.2-3ubuntu1
Pin-Priority: 1337

Package: openjdk-8-jre
Pin: version 8u272-b10-0ubuntu1~16.04
Pin-Priority: 1337

Package: openjdk-8-jre-headless
Pin: version 8u272-b10-0ubuntu1~16.04
Pin-Priority: 1337

EOF

and then the application will run with

javaws StartProRealTime.jnlp

Notes: the installation of Oracle Java 11 or 12 does not help either.


On my system I found that javaws was still trying to use jre-11 (which didn't work), because the default-jre-headless (a dependency of icedtea-netx) created a link (that was not being modified by update-java-alternatives).

$ javaws
selected jre: /usr/lib/jvm/default-java

I had to manually change that symbolic to point to the jre-8 version in order to have javaws running again.

Tags:

Java

Openjdk

Apt