This section attempts to address common issues that can occur when working with this toolchain.
Symptom: IntelliJ will display a banner at the top of the window stating that “Project SDK not defined”.
Solution: Set the SDK version for the project.
Setup SDK beside the error (or
Project from the left-hand side, and set the Project SDK to the SDK you installed. Also set the language level to the same version (e.g. 17) for both.
Build action isn’t available.
Solution: Set the location of the source code.
IntelliJ needs to know what to consider the top-level of your source directory (it may seem obvious with a simple project, but complex projects may have a complicated directory structure).
In the Explorer pane on the left, right-click on the “src” folder. Choose “Mark Directory As…” and select “Sources Root”. It should then be selectable and the Main class.
You should be able to build the project at this stage (Build-Build Project).
Run icon in IntelliJ is disabled.
Solution: Make sure to build and run from the Gradle menu (View - Tools - Gradle) at least once successfully. This will enable the toolbar and menu shortcuts, which just call the last successful build and run commands.
Symptom: Errors referring to missing components or classes. e.g. “Error: JavaFX runtime components are missing, and are required to run this application”.
Solution: Check that your
build.gradle file is setup to import the required libraries. See Creating a New Project