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

Solution 1:

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.

Solution 2:

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.

Solution 3:

I was able to set default java-8 or java-11.


$ sudo update-java-alternatives --jre --set java-1.8.0-openjdk-amd64
$ sudo update-java-alternatives --jre-headless --set java-1.8.0-openjdk-amd64
$ sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
update-alternatives: error: no alternatives for appletviewer
update-alternatives: error: no alternatives for mozilla-javaplugin.so
update-java-alternatives: jdk alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer
update-java-alternatives: jdk alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so

$ sudo update-java-alternatives --jre --set java-1.11.0-openjdk-amd64
$ sudo update-java-alternatives --jre-headless --set java-1.11.0-openjdk-amd64
$ sudo update-java-alternatives --set java-1.11.0-openjdk-amd64
update-alternatives: error: no alternatives for appletviewer
update-alternatives: error: no alternatives for mozilla-javaplugin.so

and then properly set variable JAVA_HOME by one of commands


$ export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
$ export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:jre/bin/java::")
$ echo $JAVA_HOME

It is worth to check the variable value.

When running


 $ javaws filename.jnpl

I have got some warning and response including

netx: Invalid jnlp file /home/phobos/express.jnpl

The express.jnpl is the ARIS express modelling tool from https://www.ariscommunity.com/aris-express/download

The respective responses are


$ javaws ~/express.jnpl
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre/

(java:11196): dbind-WARNING **: 19:40:56.468: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
netx: Invalid jnlp file /home/phobos/express.jnpl

$ javaws ~/express.jnpl
selected jre: /usr/lib/jvm/java-11-openjdk-amd64/
WARNING: package javax.jnlp not in java.desktop
netx: Invalid jnlp file /home/phobos/express.jnpl

Now it remains to find out whats wrong eithwer with jnpl file, or with my configuration.

SOLVED - I used wrong file name. It is working now.


$ javaws ~/express.jnlp
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre/
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre/
Codebase matches codebase manifest attribute, and application is signed. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
Starting application [com.idsscheer.aris.expresslauncher.AExpressLauncher] ...
May 02, 2019 6:36:28 PM com.idsscheer.aris.common.ADebug println
INFO: [config] creating plugin.cfg from jar file

Running ok with current version 8u212. It remains to make JAVA_HOME name change permanent.