JavaFX 11 samples to run from NetBeans with different options and build tools
Version NetBeans 10.0
Download an appropriate JDK 11 for your operating system. Make sure JAVA_HOME
is properly set to the Java 11 installation directory.
The samples assume NetBeans 10 runs on JDK 11 (this can be set editing the etc/netbeans.conf
file
and setting netbeans_jdkhome="/path/to/jdk11"
).
Download JavaFX jmods for your operating system and unzip to a desired location.
For the first time only:
-
Install manually the Gradle plugin for NetBeans 2.0.2 from the GitHub repository.
-
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 NetBeans and reload the project. Build and run
from the Tasks context-menu. 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