I am trying to use openjdk-11 on ubuntu, but my project requires javafx.

There is an openjfx package but it installs alognside with openjdk-8.

So far I only found instructions to build both openjdk and openjfx from scratch.

Any easier way?

Edit: openjdk-11 comes without javafx/openjfx by default.


First, install OpenJFX:

sudo apt install openjfx

You can then add these arguments to any java invocation:

--module-path /usr/share/openjfx/lib --add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web

I figured it out:

You have to download the latest build from the openjfx web site an run as described here: http://mail.openjdk.java.net/pipermail/openjfx-dev/2018-May/021819.html

It seems to have gtk3 enabled by default wich did not seem as stable as gtk2. So for now I have decided to stick with oracle 10 jdk and wait for openjfx to mature and have maven packages.


According to the official documentation:

With the module system in JDK 9 and later, it is not possible to easily overlay an OpenJFX build over an existing JDK as was possible with JDK 8. It is possible to build an OpenJDK that included the updated OpenJFX modules.

Therefore you either need to wait for an incoming standalone installer with JDK 11 or you have to build OpenJDK with OpenJFX from scratch.

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.