OpenJFX-11 does not work with OpenJDK-8

Bug #1799946 reported by Simon Levermann on 2018-10-25
146
This bug affects 30 people
Affects Status Importance Assigned to Milestone
openjfx (Ubuntu)
Undecided
Unassigned

Bug Description

In 18.10, the openjfx package now provides a version that is for use with the newly released Java 11. However, this openjfx package is incompatible with the still available openjdk-8-{jdk,jre} packages. The current reality is that many Java applications are not yet compatible with the Java module system, which is mandatory in Java 11. Due to this, it is currently impossible to run JavaFX applications (like JabRef in my case) which are not yet compatible with Java 11, unless I install Oracle's JDK 8 from external sources.

Would it be possible to supply an openjfx-8 package, similar to the openjdk-{8,11}-{jdk,jre}?

The version of openjfx is: 11+26-4
Version of Ubuntu is a fresh (not upgraded) install of 18.10.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: openjfx 11+26-4
ProcVersionSignature: Ubuntu 4.18.0-10.11-generic 4.18.12
Uname: Linux 4.18.0-10-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia
ApportVersion: 2.20.10-0ubuntu13
Architecture: amd64
CurrentDesktop: GNOME
Date: Thu Oct 25 14:39:06 2018
InstallationDate: Installed on 2018-10-11 (13 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Beta amd64 (20181011)
SourcePackage: openjfx
UpgradeStatus: No upgrade log present (probably fresh install)

Simon Levermann (sonofra) wrote :
information type: Public → Public Security
information type: Public Security → Public
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjfx (Ubuntu):
status: New → Confirmed
David Pyke (loftwyr) wrote :

Your app may be incompatible for other reasons.

The app I'm working with shows an inability to load the javaFX libraries until I loaded them from old debs I pulled from Debian. Then I prevented them from being updated.

JPT (j-p-t) wrote :

I've hidden my last comment because it's wrong.
I confirmed the author of this bug is right.

Yes, OpenJDK-8 cannot read the OpenJFX-11-Jars.
Yes, Java-8 apps do not run in Java-11.

But why does Jconsole report an empty/unavailable bootclasspath for OpenJDK-11?

I was able to copy the files from the openjfx package in 18.04 into my 18.10 manually and was able to launch Oracle SQLDeveloper which is what I needed the package for.

JPT (j-p-t) wrote :

workaround:

add bionic repo to your apt-sources:
deb http://de.archive.ubuntu.com/ubuntu/ bionic universe

maybe you should add "updates" or "security" repo too.

test with or immediately pin with the file below
sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2

pin the version by creating this file
$ cat /etc/apt/preferences.d/openjfx
Package: openjfx
Pin: release a=bionic
Pin-Priority: 1001

Package: libopenjfx-java
Pin: release a=bionic
Pin-Priority: 1001

JPT (j-p-t) wrote :
Simon Levermann (sonofra) wrote :

The problem with the "get oracle java" workaround is that oracle java is no longer free (as in beer):

https://www.oracle.com/technetwork/java/javaseproducts/overview/javasesubscriptionfaq-4891443.html

herrsaalfeld (herrsaalfeld) wrote :

On bionic, you will also have to downgrade libopenjfx-jni
```
sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2
```

Kristian Rink (kawazu) wrote :

Stumbled into this problem here as well both with a couple of internal Java applications and some FLOSS apps such as mediathekview (https://mediathekview.de/) in Germany.

Currently, Java 11 -> Java 8 downgrade or even installing both in parallel on any Ubuntu/Debian system works well, however for that to work with JavaFX applications it would be required to also be able to install different versions of openjfx - such as openjfx-11 for openjdk-11 and openjfx-8 for openjdk-8. Right now, the only working solution using the package repository is manually downgrading and pinning openjfx libs, which unfortunately also will prevent any option to provide updates to the openjfx-8 versions if ever needed.

Simon Levermann (sonofra) wrote :

As of a few weeks ago, Oracle will no longer supply free updates (security or otherwise) to oracle-jdk/jre-8. So now the only way to get Java 8-only applications, which still constitute a large portion is to use pinning of the openjfx package.

Kristian Rink (kawazu) wrote :

Yes, but the suggested approach ("Would it be possible to supply an openjfx-8 package, similar to the openjdk-{8,11}-{jdk,jre}?") would both fix this problem and make versioning of the openjdk- and openjfx- packages (which, despite being separate packages, are pretty closely tied to each other) immensely more concise. ;)

Simon Levermann (sonofra) wrote :

I'm aware of this, I was merely pointing out that the lack of oracle updates for java 8 now removes one of the possible workarounds, making the only still-working workaround.

I'm not familiar with the rules on the Ubuntu Bugtracker, but doesn't this effectively now make this a "security" bug? Since pinning disables updates, as well as Oracle no longer providing security updates for JDK version 8?

Kristian Rink (kawazu) wrote :

Hmmm, ok, I am unsure how Oracle and OpenJDK/JFX relate to each other, and whether the Open* variants will continue to see any community updates. The whole post-Java8-world still is a difficult thing to handle.

Simon Levermann (sonofra) wrote :

It looks like this isn't going to happen:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910407#15

pascal (deneaux) wrote :

This bug also effects the greenfoot project.

Since the PPA ppa:webupd8team/java is discontinued, there is no way to run greenfoot under Ubuntu.

I'm a teacher and it would be very helpful to have an openjfx-8 package so that i can run greenfoot.

```
$ greenfoot
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at bluej.Boot.main(Boot.java:193)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
 at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 ... 13 more

```

pascal (deneaux) wrote :

ok. This works:

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

1proton (1proton) wrote :

Thank you pascal, herrsaalfeld and others! This solution worked also for me on Ubuntu 18.10 when using Mediathekview.

ps.:I had to reboot; maybe a logout/login would do it also

BR

herrsaalfeld (herrsaalfeld) wrote :

I would like to add that the proposed workaround to downgrade the openjfx packages is NOT a solution because no security updates will be available. The correct solution is to provide an openjfx-8 package as proposed by the TO or to roll back the openjfx package to version 8. The current openjfx package breaks the openjdk-8 package for Java FX applications and is unnecessary because openjfx-11 is a jar only solution that does not require package management by Ubuntu but can be fetched via maven or alike.

While this is not fixed, the packages have to be put on hold for updates

sudo apt install \
  openjfx=8u161-b12-1ubuntu2 \
  libopenjfx-java=8u161-b12-1ubuntu2 \
  libopenjfx-jni=8u161-b12-1ubuntu2
sudo apt-mark hold \
  openjfx \
  libopenjfx-java \
  libopenjfx-jni

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.