1

Eclipse JavaFX - Ubuntu 19.1 - EclipseJava - JavaFX not found

Hello

I use Linux Mint (19.1) with EclipseForJavaDeveloppers. I created a new JavaFx project in Eclipse, resulting in the following:

The import javafx cannot be resolved.

When i try to identify where my javafx packages are located (which openjfx), there is no response. I found however some javafx jars in /usr/share/java...

Does someone know how to setup my system correctly?

Information (system)

Packages installed with apt:

  • default-jdk
  • default-jre
  • openjfx

Environment variables

I have added the enviroment variables to my .bashrc as follows:

export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export JAVAFX_HOME="/usr/share/java"  

Java version

The "java -version" is:

openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Ubuntu-3ubuntu118.04.3)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Ubuntu-3ubuntu118.04.3, mixed  
mode, sharing)

Ubuntu version

The Ubuntu Release version "lsb_release -a" is:

LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 19.1 Tessa
Release:    19.1
Codename:   tessa
user654789384
  • 305
  • 1
  • 4
  • 21
  • See https://openjfx.io/openjfx-docs/#IDE-Eclipse, make sure you have JavaFX installed (check `lib` folder for javafx jars and .so libraries) – José Pereda Apr 30 '19 at 16:45

1 Answers1

0

The reason being is that JavaFX was not included in JDK 11.

The reason for the computer not seeing Javafx when you added it in the path does confuse me, but in Eclipse, I would suggest

1) Installing the JavaFX .JAR here https://gluonhq.com/products/javafx/

2) Add the JavaFX import to the project, here is a tutorial to do so: How to import a jar in Eclipse

I would say Use IDEA Community because it has the best support for JavaFX in general. Hopefully this can help you!

Then you should be able to click run in Eclipse and it should start the JavaFX application.

Corie LeClair
  • 51
  • 1
  • 9