IntelliJ IDEA 2019.2 Help

SDKs

A Software Development Kit, or an SDK, is a collection of tools that you need to develop an application for a specific software framework. For example, to develop applications in Java, you need a Java SDK (JDK). SDKs contain binaries, source code for the binaries, and documentation for the source code. For Java, SDKs also contain annotations.

Generally, SDKs are global. It means that one SDK can be used in multiple projects and modules. After you create a new project and define an SDK for it, you can configure modules in this project to inherit its SDK. You can also specify an SDK for each module individually. For more information, refer to Change module SDK.

Define an SDK

To define an SDK means to let IntelliJ IDEA know in which folder on your computer the necessary SDK version is installed. This folder is called SDK home directory.

Manage global SDKs

  1. From the main menu, select File | Project Structure Ctrl+Shift+Alt+S.

  2. On the panel on the left, locate the Platform Settings section and select SDKs.

  3. To add a new SDK or a new SDK version, click the Add button Shift+Enter, select the SDK type and specify its installation directory.

  4. To remove an SDK, select it in the list and click the Remove button Alt+Delete.

Show available JDKs

Change project SDK

  1. From the main menu, select File | Project Structure Ctrl+Shift+Alt+S.

  2. On the panel on the left, locate the Project Settings section and select Project.

  3. From the Project SDK list, select another SDK or SDK version.

    If the necessary SDK is not defined in IntelliJ IDEA yet, click New and specify its home directory.

Change a JDK

Change module SDK

  1. From the main menu, select File | Project Structure Ctrl+Shift+Alt+S.

  2. On the panel on the left, locate the Project Settings section and select Modules.

  3. Select the necessary module and click Dependencies.

  4. From the Module SDK list, select another SDK or SDK version you want to use.

    If the necessary SDK is not defined in IntelliJ IDEA yet, click New and specify its home directory.

If you want a module to inherit a project SDK, select the Project SDK option from the Module SDK list.

Manage JDK modules

Java Development Kit (JDK)

To develop applications in IntelliJ IDEA, you need the Java SDK (JDK). The JDK is a software package that contains libraries, tools for developing and testing Java applications (development tools), and tools for running applications on the Java platform (Java Runtime Environment — JRE).

The JRE can be obtained separately from the JDK, but it's not suitable for application development, as it doesn't have essential components such as compilers and debuggers.

IntelliJ IDEA doesn't come with the JDK, so if you don't have the necessary JDK version, download and install it. Note that some frameworks require their own SDKs in addition to the JDK, for example, Android or Grails.

Download a JDK package

  1. Open the jdk.java.net website.

    There, you'll find the Oracle's OpenJDK binaries for Windows, macOS, and Linux as .tar.gz and .zip archives.

  2. Select and download the necessary JDK version.

    If you're not sure which version you need, select the latest stable version.

  3. Unzip the archive and place the folder with Java to a meaningful location, for example: /Library/Java/JavaVirtualMachines on macOS or to C:\Program Files\Java on Windows.

Example: Setting up the project JDK

  1. From the main menu, select File | Project Structure Ctrl+Shift+Alt+S.

  2. On the panel on the left, locate the Project Settings section and select Project.

  3. In the Project SDK section, click New and specify the path to the Java directory on your computer.

  4. Apply the changes and close the dialog.

Last modified: 20 September 2019