2

I have just ended clean installation of the Ubuntu 16.04 LTS. I installed Scilab here from the official repository as simple as sudo apt-get install scilab.

Then I tried to launch it from the GUI, but it does not start. Running scilab from the terminal gives the following output:

$ scilab
Could not access to the Main Scilab Class:
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.scilab.modules.localization.Messages.gettext(Unknown Source)
    at org.scilab.modules.commons.xml.XConfiguration.<clinit>(Unknown Source)
    at org.scilab.modules.core.Scilab.<clinit>(Unknown Source)
Caused by: java.lang.NullPointerException
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
    at java.lang.Runtime.loadLibrary0(Runtime.java:871)
    at java.lang.System.loadLibrary(System.java:1124)
    at org.scilab.modules.localization.MessagesJNI.<clinit>(Unknown Source)
    ... 3 more

Scilab cannot create Scilab Java Main-Class (we have not been able to find the main Scilab class. Check if the Scilab and thirdparty packages are available).

So it has problems with Java and OpenJDK. I have only one Java in my system:

$ update-java-alternatives -l
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64

How can I fix the problem with Scilab start?

K7AAY
  • 17,705
N0rbert
  • 103,263

1 Answers1

1

Update 2020-04-29:
the fix below is no longer needed, we can use Java and Scilab from latest updates.


I have reported bug 1863726 to Launchpad about this crash first.

Then I installed Ubuntu 16.04.0 LTS and did not installed any updates in it. Scilab runs normally on a such system.

So I decided to freeze/pin/lock OpenJDK package to the previous 232 version from launchpad.

Warning: do not run commands below if you really concerned about security.

cd ~/Downloads
wget https://launchpadlibrarian.net/446930389/openjdk-8-jre_8u232-b09-0ubuntu1~16.04.1_amd64.deb
wget https://launchpadlibrarian.net/446930388/openjdk-8-jre-headless_8u232-b09-0ubuntu1~16.04.1_amd64.deb

sudo apt-get install ./openjdk-8-jre_8u232-b09-0ubuntu1~16.04.1_amd64.deb ./openjdk-8-jre-headless_8u232-b09-0ubuntu1~16.04.1_amd64.deb

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-java-scilab
Package: openjdk-8-jre:amd64
Pin: version 8u232-b09-0ubuntu1~16.04.1
Pin-Priority: 1337

Package: openjdk-8-jre-headless:amd64
Pin: version 8u232-b09-0ubuntu1~16.04.1
Pin-Priority: 1337
EOF

And now I can run Scilab 5.5.2 as before.

N0rbert
  • 103,263