A Java project may need a specific release of the compiler, standard libraries and runtime. On Linux, IntelliJ IDEA uses the SDK setting in Project Structure to assign a Java Development Kit (JDK) to a project.
Modules that inherit the project SDK use the JDK you select. A module with its own SDK or an application run configuration with a specific Java runtime can still use a different installation.
Language level controls which Java syntax the project accepts. A project that pins this setting needs a JDK that supports that language level. When the setting is SDK default, it follows the selected JDK.
Steps to set the project JDK in IntelliJ IDEA:
Start with a plain Java project that uses the IntelliJ build system and whose module inherits the project SDK. The JDK you want is already available in IntelliJ IDEA. For the check in the Run tool window, the open main class prints its Java runtime version, as the hello example does with Runtime.version(). Current File is selected in the run widget. IntelliJ IDEA shows its main menu under the Main Menu button in the window header, as in a new installation.
- Open Main Menu in the window header.

- Open Project Structure… from the File menu.

- Select Project under Project Settings if another page is open in the dialog.

- Open the SDK dropdown.

- Highlight the JDK you want with the arrow keys.
The
helloproject in~/IdeaProjects/helloswitches from Java 21 to Java 25.0.5 in Detected SDKs. - Press
Enterto select the highlighted JDK.
- Press
Enteragain to save the project SDK.
If Analyzing project… appears in the status bar, wait for it to clear before running the application.
- Run the open main class with the green Run button in the toolbar.

- Confirm that the Java version printed in Run matches the JDK release you selected.
The
helloprogram prints a version starting with25.0.5.