When trying to compile an JavaFX application in the environment:
java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
I get the error-message:
cannot access javafx.event.EventHandler
[ERROR] class file for javafx.event.EventHandler not found
I tried to find a solution by following these links:
The most promising actions where to
But the error persists.
What needs to be done to get OpenJDK 8 and JavaFX working on Ubuntu 18.04.2 LTS?
There are org. openjfx artifacts for OpenJFX 11 onwards, but they won't work with Java 8.
JavaFX is included in Oracle JDK 8 running on OS X, Linux x86 and Windows. The best place to learn more about this is the Oracle Client Technologies documentation for JavaFX.
Install the Standalone JavaFX Runtime Verify your system requirements. Go to the JavaFX Downloads page. Find the JavaFX Runtime downloads, click the link for your operating system, and follow the prompts to save the executable file. Run the .exe file.
The hint from
https://github.com/JabRef/help.jabref.org/issues/204
helped. The commands:
apt purge openjfx
apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2
apt-mark hold openjfx libopenjfx-jni libopenjfx-java
fixed the problem. Many thanks to https://github.com/Druidefix for this. (If you'd like to answer this yourself I'll happily delete my own answer ...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With