2

Today I ran apt upgrade on my Ubuntu 18.04 LTS and after that, an installed JavaFX 8 application (internally developed tool) stopped working.

Running the application only brings the following error:

$ java -jar app.jar
Error: Could not find or load main class ui.Main
2

As it turns out, Canonical decided to ship a new version of openjfx. (Incidentally, is there a place where one can see such version changes/decisions?)

The relevant information can be found in /var/log/apt/history.log:

Start-Date: 2019-04-29  07:10:19
Commandline: apt upgrade
Requested-By: tannerli
Install: [snip]
Upgrade: [...]
openjfx:amd64 (8u161-b12-1ubuntu2, 11.0.2+1-1~18.04.2)
openjfx-source:amd64 (8u161-b12-1ubuntu2, 11.0.2+1-1~18.04.2)
libopenjfx-java:amd64 (8u161-b12-1ubuntu2, 11.0.2+1-1~18.04.2)
libopenjfx-jni:amd64 (8u161-b12-1ubuntu2, 11.0.2+1-1~18.04.2)
[...]

There's an open bug at LaunchPad and quite a few similar questions on various StackExchange sites concerning this, this one for example. None of those fit my specific needs. Seems there is no real solution to this day, only a

Workaround

Explictly downgrade all openjfx packages to the previous version:

$ sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 openjfx-source=8u161-b12-1ubuntu2

Hold back the affected packages, so that the next apt upgrade won't break things again:

$ sudo apt-mark hold libopenjfx-java libopenjfx-jni openjfx openjfx-source

This will show up as info when you're upgrading next time:

$ sudo apt upgrade
[...]
The following packages have been kept back:
  libopenjfx-java libopenjfx-jni openjfx openjfx-source
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.