javaterminaljavafx-8vimeoparrot-os

Learn JavaFX without IDE


i want to learn javaFX but online sources only show installation and setup in an IDE like: Netbeans , Eclipse , IntelliJ etc.

but i want to do it without IDE
ie : using only Terminal and a text editor(vim).

what is the steps to set up JavaFX for a projects and run it without any IDE.

JDK version:- 11.0.4
Os :- Parrot OS


Solution

    1. first download your desired version of java i would recommend openjdk-11
      sudo apt install openjdk-11-jdk
    2. download the javaFx from here
    3. set the JAVA_HOME environment variable to the JDK installation directory (this answer would help)
    4. set the PATH_TO_FX environment variable by the same way as above but the path should point to /lib eg: export PATH_TO_FX=path/to/javafx-sdk-11/lib
    5. compile and run your javafx code like this :

    javac --module-path $PATH_TO_FX --add-modules javafx.controls [filename].java

    java --module-path $PATH_TO_FX --add-modules javafx.controls [filename]