I can't seem to get javaFX working on my system. I need it for a school project.
I've done some research into this matter and concluded the following :
Current JDK versions do not standardly include javaFX anymore. So I need to download and install it manually. I came across this website : https://openjfx.io/openjfx-docs/#introduction which instructs me to install Java11 OpenJDK which I believe includes JavaFX.
I've downloaded the macOS version from this link : http://jdk.java.net/11/ Unzipped it. and copied it manually to this location : "/Library/Java/JavaVirtualMachines/ (the folder itself is called jdk-11.0.2.jdk
The openjfx website instructed me next to set the HOME environment variable. And it included a tutorial on how to do that. I've then successfully changed my JAVA_HOME variable as instructed. (tutorial link : https://www.baeldung.com/java-home-on-windows-7-8-10-mac-os-x-linux)
My java version now looks similar to the one on the openjfx website enter image description here
The website then instructs to download a appropriate JavaFX runtime from this source : https://gluonhq.com/products/javafx/ It says to download and extract that file to a "desired" location. Which I would assume would be this : /Library/Java/JavaVirtualMachines/ So I moved the extracted openjfx-11_osx-x64_bin-sdk.zip to that location. Finally it instructs me to add the following environment variable : export PATH_TO_FX=path/to/javafx-sdk-11.0.1/lib
To, I assume, my bash profile so I did that. I substituted the path/to/ part with the actual path. Which would be : export PATH_TO_FX=/Library/Java/JavaVirtualMachines/javafx-sdk1.3/lib
(the zip indeed containts a lib folder with javafx.jar files)
At this point this is how my bash profile looks : Bash profile screenshot
So basically the openjfx site now says I should be okay to run javafx 11 applications from the command line. With a specified command.
So with this long command javac --module-path /Library/Java/JavaVirtualMachines/javafx-sdk-11.0.2/lib --add-modules=javafx.controls HelloFx.java
I am able to successfully run a java file which imports javaFx. But this is so cumbersome.
I suspect I should do something with setting my environment/path variables so that I can use JavaFX from within IntelliJ or preferably in MS visual studio code.
Does anyone know a concise and straightforward way to configure my system so that I can just use Java and JavaFX from Vistual Studio Code or IntellJ