Setting up
Prerequisites
- JDK 11
- Recommended: IntelliJ IDE
- Fork this repo to your GitHub account and clone the fork to your computer
Importing the project into IntelliJ
- Open IntelliJ (if you are not in the welcome screen, click
File>Close Projectto close the existing project dialog first). - Set up the correct JDK version.
- Click
Configure>Structure for new Projects(in older versions of Intellij:Configure>Project Defaults>Project Structure). - If JDK 11 is listed in the drop down, select it. If it is not, click
New...and select the directory where you installed JDK 11. - Click
OK.
- Click
- Click
Import Project. - Locate the project directory and click
OK. - Select
Create project from existing sourcesand clickNext. - Rename the project if you want. Click
Next. - Ensure that your src folder is checked. Keep clicking
Next. - Click
Finish.
Setting up Java FX
If you are not using Gradle
-
Download the JavaFX 11 SDK and unzip it.
-
Import the
libsfolder from the SDK into your project (note:JAVAFX_HOMEis 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 yourVM optionsfor each of themainclasses.--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
If you are using Gradle
Update your build.gradle to include the following lines:
plugins {
id 'java'
id 'org.openjfx.javafxplugin' version '0.0.10'
}
repositories {
mavenCentral()
}
javafx {
version = "11.0.2"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
Errors you may face
classpath issues
- Ensure that During Installation, use default location of installation.
- Right Click Resource folder for JavaFxml Docs to be Resource Root Folder.