Install openJDK+openJFX 8 on Ubuntu 20

If you are set on using JDK 8 and JavaFX, I've found it's best to install an OpenJDK that includes JavaFX.

For version 8, not all OpenJDKs include JavaFX (e.g. AdoptOpenJDK). The best ones I have found are

  • Zulu : You must select "JDK FX" in the Java Package drop down
  • Liberica: You must select "Full JDK"

Liberica provides builds for raspberry pi and a wide variety of other architectures. If you need that, Liberica is the way to go.


I stumbled upon the same problem and found that the easiest solution is to use sdkman: https://sdkman.io/install

With these three commands I was able to have openjdk 8 with JavaFX installed on Ubuntu 20.04:

curl -s "https://get.sdkman.io" | bash

source "$HOME/.sdkman/bin/sdkman-init.sh"

sdk install java 8.0.252.fx-zulu


Install Liberica JDK / JRE via Aptitude

Liberica JDK is quite easy to install on Ubuntu / Debian based operating systems which support the aptitude package manager.

All you have to do is to add the official BellSoft repository:

wget -q -O - "https://download.bell-sw.com/pki/GPG-KEY-bellsoft" | sudo apt-key add -
echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list

And after that update your packages and install the full bellsoft java version. It is important that you use the full version, as it is the only one coming with JFX. Also bear in mind that you should uninstall all previously installed java versions via apt purge before installing this java version.

sudo apt-get update
sudo apt-get install bellsoft-java8-full

You can use bellsoft-java8-runtime-full to safe some space if you only need the JRE. After the installation is completed applications using JavaFX work just fine.

In case you are not using the Ubuntu repository because you are using Debian for example you need to enter the following command to make sure there is no verification error on apt update for the Bellsoft repository.

#Use this only in case there is a verification error on update
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 32E9750179FCEA62

If you are not using an operating system with the aptitude package manager there are also some other package managers like yum and yast supported. Click here