- Add an environment variable that points to the
lib
directory. This step is optional really but it is more convenient.
$env:PATH_TO_FX="path-to-the-file"
example:
$env:PATH_TO_FX="C:\Projects\javafx-sdk-11.0.2\lib"
This will store the value in $env:PATH_TO_FX
temporarily. To store it permanently, store it in the Environment Variables
. Detailed Tutorial is here. Set the name PATH_TO_FX
and value path to the lib
instead of JAVA_HOME
and its value.
- Compile the application. First navigate to the folder containing
.fxml
and.java
files from powershell.
javac --module-path $env:PATH_TO_FX --add-modules javafx.controls,javafx.fxml *.java
This runs all .java
files in the directory.
- Run the application
java --module-path $env:PATH_TO_FX --add-modules javafx.controls,javafx.fxml DrawSteppedLines
More detailed tutorial is here on setting up and running JavaFX applcation.