“Error: package javafx.geometry does not exist” solution/troubleshooting

Hi guys,

If you faced “Error: package javafx.geometry does not exist” error and if you couldn’t find any solution, you’re right there :))

I spent hours on this problem. I am writing this article so that no one does not spend hours with this problem.

The default openjfx package on Ubuntu 18.04 is not compatible with OpenJDK 8. You may use the older version of the openjfx package. Please note that it’s not a fully secure solution because you won’t get updates for the package.

Firstly, make sure java-8 using in your system.

Image for post
Image for post
Java usage configurion

After that check java version.

Image for post
Image for post
java version information

If everything is normal, you can skip the next step. Make sure below jdk/jre’s install normally.

sudo apt-get install openjdk-8-jdk-headless
sudo apt-get install openjdk-8-jre

After that, install openjx for openjdk-8

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

When you installed openjx for openjdk-8, apt-mark hold openjfx for the new updates.

sudo apt-mark hold \
openjfx \
libopenjfx-java \

Ref: https://askubuntu.com/questions/1137891/how-to-install-run-java-8-and-javafx-on-ubuntu-18-04

Written by

Software Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store