JavaFX 11 samples to run from IntelliJ with different options and build tools
Version IntelliJ IDEA 2018.3.3
Download an appropriate JDK 11 for your operating system. Make sure JAVA_HOME
is properly set to the Java 11 installation directory.
Download JavaFX jmods for your operating system and unzip to a desired location.
- Add
org.gradle.java.home
to agradle.properties
file, with the path to JDK 11, andpath.to.fx.mods
to agradle.properties
file, with the path to JDK jmods. This file can be part of the project or under the gradle user homeUSER_HOME/.gradle
.
Clone the sample, open it with IntelliJ and import the Gradle changes. Build and run
from the Gradle window. Run the jlink
task to create a custom runtime image:
On Linux or Mac run:
build/hellofx/bin/java -m hellofx/org.openjfx.MainApp
On Windows, run:
build\hellofx\bin\java -m hellofx/org.openjfx.MainApp