IntelliJ IDEA 2020.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. JDK builds 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.

Supported SDKs:

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 an SDK home directory.

Configure global SDKs

  1. From the main menu, select File | Project Structure | Platform Settings | SDKs.

  2. To add an SDK, click the Add button, select the necessary SDK and specify its home directory in the dialog that opens.

    Only for JDKs: if you don't have the necessary JDK on your computer, select Download JDK. In the next dialog, specify the JDK vendor, version, change the installation path if required, and click Download.

Show available SDKs in the Project Structure dialog

Set up a project SDK

  1. From the main menu, select File | Project Structure | Project Settings | Project.

  2. If the necessary SDK is already defined in IntelliJ IDEA, select it from the Project SDK list.

    If the SDK is installed on your computer, but not defined in the IDE, select Add SDK | 'SDK name', and specify the path to the SDK home directory.

    Only for JDKs: If you don't have the necessary JDK on your computer, select Add SDK | Download JDK. In the next dialog, specify the JDK vendor, version, change the installation path if required, and click Download.

Change the project SDK

Set up a module SDK

  1. From the main menu, select File | Project Structure | Project Settings | Modules.

  2. Select the module for which you want to set an SDK and click Dependencies.

  3. If the necessary SDK is already defined in IntelliJ IDEA, select it from the Module SDK list.

    If the SDK is installed on your computer, but not defined in the IDE, select Add SDK | 'SDK name', and specify the path to the SDK home directory.

    Only for JDKs: If you don't have the necessary JDK on your computer, select Add SDK | Download JDK. In the next dialog, specify the JDK vendor, version, change the installation path if required, and click Download.

Setting up another module-level SDK

Java Development Kit (JDK)

To develop applications in IntelliJ IDEA, you need a Java SDK (JDK). A 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.

In IntelliJ IDEA, you can download a JDK package right from the IDE, or you can manually download the necessary JDK distribution and define it in the IDE.

For a manual download, use any available distribution that you like, for example:

Set up the project JDK

  1. From the main menu, select File | Project Structure | Project Settings | Project.

  2. If the necessary JDK is already defined in IntelliJ IDEA, select it from the Project SDK list.

    If the JDK is installed on your computer, but not defined in the IDE, select Add SDK | JDK, and specify the path to the JDK home directory (for example, /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk).

    Change a project SDK

    If you don't have the necessary JDK on your computer, select Add SDK | Download JDK. In the next dialog, specify the JDK vendor, version, change the installation path if required, and click Download.

  3. Apply the changes and close the dialog.

    Setting up the JDK for a project

Specify SDK documentation paths

External documentation opens the necessary information in a web browser, so that you can navigate to related symbols and keep the information for further reference at the same time. After you configure external documentation for your project, you can also view it in a quick documentation popup.

Configure the external documentation path

To view external documentation, you need to configure the documentation URL first.

  1. In the Project Structure dialog Ctrl+Alt+Shift+S, select SDKs.

  2. Select the necessary SDK version if you have several SDKs configured, and open the Documentation Path tab on the right.

  3. Click the Specify URL icon and enter the external documentation URL. For example, for Java 14, type https://docs.oracle.com/en/java/javase/14/docs/api/).

  4. Apply the changes and close the dialog.

For more information on how to open external documentation and how to work with it offline, refer to External documentation.

Last modified: 10 July 2020