I have installed openjdk 11 and openjfx (using "apt get install openjfx").
Tried to use "import javafx" and "import openjfx" in the code and javac always says that there is no such package.
There is a new way to work with JavaFX if you are using Java 11. This is their official web site: https://openjfx.io/openjfx-docs/#install-javafx
Inside is described how to:
- Install Java 11 (JRE or JDK)
- Download their JavaFX runtime from: https://gluonhq.com/products/javafx/
- Export the path of the JavaFX runtime:
compile and run java application with module path to the PATH_TO_FX and the necessary modules:
javac --module-path $PATH_TO_FX --add-modules javafx.controls (other javaFX modules) HelloFX.java
java --module-path $PATH_TO_FX --add-modules javafx.controls (other javaFX modules) HelloFX
For more information please visit their website read https://openjfx.io/openjfx-docs/#install-javafx and also read some information on java 9 module system.
Best luck to all!