A strange behaviour of OpenJFX

I need to run an application which depends on OpenJFX. After installing the openjfx package from official source, the application still can’t find OpenJFX. I must use:


java --module-path /usr/share/java/openjfx/ --add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web -jar abc.jar

But on Windows and Arch Linux or on openSUSE with Oracle JDK 8, only “java -jar abc.jar” is needed. So is this a bug?

[HR][/HR]System information:
Operating System: openSUSE Tumbleweed 20210105
Kernel Version: 5.10.4-1-default
OS Type: 64-bit
Java Version: OpenJDK 11

I am not sure, but I guess that you expected that the installation you did (which you not describe, only that it is “from official source”) should have done the adding of the modules?
When yes. IMHO this could be a bug in that installation procedure, which probably originates from that “official source”.

Oh, I mean the openSUSE official source. But the problem is solved. OpenJFX is not included in Java 11’s module path, so some extra work is needed. Thank you.

OK, nice you found out.

But next time better do not use vague terms like “official”, but simply call it by name, like “The OSS repo”.

Why did you install from an outside project?

i did a little experimentation just now because it looks like openjfx has undergone another deployment change since I last looked at it (I’m wary, I’ve observed at least 4 major changes over the past 6 years or so, all upstream). In the past, openjfx has generally had a close relationship, sometimes integrated with openjdk-devel, but more recently seems to have separated but I would guess still has a close versioning relationship and of course, openjdk-devel is the JDK equivalent of the runtime openjdk.

What the above means is that you risk problems installing openjdk from an outside project because there is likely nothing that installs it properly linking to openjdk-devel.

Just now on a LEAP 15.2… but I would not expect should be any different on a Tumbleweed, it now looks like openjfx is its own package (something new!) from the “java:packages” repo.
You can find it using the web software search tool at the following page
https://software.opensuse.org/package/openjfx

The one-click install didn’t work for me, but it might have been my ham-handed fingers early in the morning… I installed the repo using zypper

zypper ar -f http://download.opensuse.org/repositories/Java:/packages/$releasever/ Java_repository

installed javafx

zypper in javafx

And watched the Alternatives symlinks created as expected during the install (openSUSE uses “update-alternatives” to switch between installed java).

I then verified that javafx is installed tightly integrated with the installed openjfx-devel by testing whether I could run update-alternatives directly against javafx. Since I’m unable to do so (Can also verify by inspecting /etc/alternatives/), javafx is obviously automatically working by choosing my java version.

TSU

1 Like