Bookmark this to keep an eye on my project updates!
This is a project template for a greenfield Java project. It’s named after the Java mascot Duke. Given below are instructions on how to use it.
Prerequisites
Importing the project into IntelliJ
File > Close Project to close the existing project dialog first).Configure > Structure for new Projects (in older versions of Intellij:Configure > Project Defaults > Project Structure).New... and select the directory where you installed JDK 11.OK.Import Project.OK.Create project from existing sources and click Next.Next.Next.Finish.Download the JavaFX 11 SDK and unzip it.
Import the libs folder from the SDK into your project (note: JAVAFX_HOME is the directory in which you have unzipped the JavaFX SDK).
File > Project Structure > Libraries > + > Java > {JAVAFX_HOME}/lib
From Run > Edit Configurations, add the following line into your VM options for each of the main classes.
--module-path {JAVAFX_HOME}/lib --add-modules javafx.controls,javafx.fxml
e.g., --module-path C:/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml
Update your build.gradle to include the following lines:
plugins {
id 'java'
id 'org.openjfx.javafxplugin' version '0.0.7'
}
repositories {
mavenCentral()
}
javafx {
version = "11.0.2"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}