IntelliJ IDEA 13.1 Web Help

To find out how various Software Developmnet Kits (SDKs) are used in IntelliJ IDEA, see SDK.

On this page:

To configure SDKs at the global (IDE) level
  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCommand SemicolonCommand SemicolonCommand Semicolon).
  2. In the left-hand pane, under Platform Settings, click SDKs.
  3. To add a new SDK, click add and select the desired SDK type.
  4. In the dialog that opens, select the SDK home directory and click OK.

    As a result, a new SDK is added to IntelliJ IDEA, and its settings are shown on the SDK page in the right-hand part of the dialog.

  5. Optionally, edit the SDK name and contents.
  6. If necessary, add more SDKs as described above.
  7. Click OK in the Project Structure dialog.
To configure a project SDK
  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCommand SemicolonCommand SemicolonCommand Semicolon).
  2. In the left-hand pane, under Project Settings, click Project.
  3. On the page that opens in the right-hand part of the dialog, select the necessary SDK from the Project SDK list.
  4. If the desired SDK is not present in the list, click New and select the necessary SDK type.
  5. In the dialog that opens, select the SDK home directory and click OK.

    As a result, a new SDK is added to IntelliJ IDEA and selected as the project SDK.

  6. To view or edit the SDK name and contents, click Edit. (The SDK page will open.)
  7. Click OK in the Project Structure dialog.
To configure a module SDK
  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCommand SemicolonCommand SemicolonCommand Semicolon).
  2. In the left-hand pane, under Project Settings, click Modules.
  3. In the area under project_structure_toolbar_2_modules, select the module of interest.
  4. In the right-hand part of the dialog, on the Module page, select the Dependencies tab.
  5. Select the SDK from the Module SDK list. (To select the project SDK, select Project SDK. Note that if you change the project SDK later, the module SDK will change accordingly.)
  6. If the desired SDK is not present in the list, click New and select the necessary SDK type.
  7. In the dialog that opens, select the SDK home directory and click OK.

    As a result, a new SDK is added to IntelliJ IDEA and associated with the module.

  8. To view or edit the SDK name and contents, click Edit. (The SDK page will open.)
  9. Click OK in the Project Structure dialog.
To make Apple JDK sources accessible in IntelliJ IDEA on Mac OS X

The Apple JDK included in Mac OS X installation doesn't contain the JDK sources. So to make those sources accessible in IntelliJ IDEA, you should download and install the Java for Mac OS X Developer Package and then add the JDK sources contained in this package (src.jar) to the definition of the corresponding JSDK in IntelliJ IDEA.

  1. In a Web browser, go to the Downloads for Apple Developers page.
  2. Sign in to the downloads page using your Apple developer account (Apple ID and password).
  3. Download and install the Java for Mac OS X Update Developer Package suitable for the Mac OS X version that you are using.
  4. In IntelliJ IDEA, open the Project Structure dialog (e.g. Ctrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCtrl+Shift+Alt+SCommand SemicolonCommand SemicolonCommand Semicolon).
  5. In the left-hand pane, under Platform Settings, select SDKs.
  6. In the second from the left pane, select the Apple JDK of interest. (If the corresponding JDK is not present in the list, add its definition, see Configuring SDKs at the global (IDE) level.)
  7. On the SDK page shown in the right-hand part of the dialog, select the Sourcepath tab and click add (Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter).
  8. In the dialog that opens, select the file src.jar and click OK.

    (Usually, this file is located in

    /Library/Java/JavaVirtualMachines/<java.version>/Contents/Home

    where <java.version> is your JDK version, for example, 1.6.0_31-b04-415.jdk or something similar.)

  9. Click OK in the Project Structure dialog.

See Also

Concepts:

Reference:

Web Resources: