Write a build script. Here is a template for JavaFX applications:
plugins {
id "application" // Use Application plugin
id "org.openjfx.javafxplugin" version "0.0.9" // Use JavaFX plugin
}
mainClassName = "my.package.Application" // Set this to your main class
repositories {
mavenCentral()
}
javafx {
version = "16" // JavaFX Version
modules = [ "javafx.controls" ] // JavaFX modules. Add them to this array.
}
Once you have finished, import the project:
This may take a while depending on your internet speed.
You may have to adjust runtime configurations to use Gradle, but that shouldn't be necessary.
You may encounter the following error:
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
You may also need to rearrange the source folders:
I apologise for the cat photo, but it was just a placeholder image. I definitely didn't specifically choose it.