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.

  1. Open Main Menu in the window header.
  2. Open Project Structure… from the File menu.
  3. Select Project under Project Settings if another page is open in the dialog.
  4. Open the SDK dropdown.
  5. Highlight the JDK you want with the arrow keys.

    The hello project in ~/IdeaProjects/hello switches from Java 21 to Java 25.0.5 in Detected SDKs.

  6. Press Enter to select the highlighted JDK.
  7. Press Enter again to save the project SDK.

    If Analyzing project… appears in the status bar, wait for it to clear before running the application.

  8. Run the open main class with the green Run button in the toolbar.
  9. Confirm that the Java version printed in Run matches the JDK release you selected.

    The hello program prints a version starting with 25.0.5.

Share this guide