CS 346 (W23)
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage


This section attempts to address common issues that can occur when working with this toolchain.

Error 1: Unable to locate SDK

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.

Click on Setup SDK beside the error (or File-Project Structure).

Select 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.

Setting project SDK

Error 2: “Build” not available

Symptom: The 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 need to set source-root for IntelliJ to locate source files

You should be able to build the project at this stage (Build-Build Project).

Error 3: “Run” Not Available

Symptom: The 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.

Error 4: Missing Classes

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