IntelliJ IDEA 13.1 Web Help

On this page:

See also, Library, Configuring Module Dependencies and Libraries and Configuring JavaScript Libraries.

Creating a project or a global library
  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. Depending on the library level, in the left-hand pane of the dialog, select:
    • Libraries if you are going to create a project library.
    • Global Libraries if you are going to create a global library.
  3. Above the pane to the right, click add and select one of the following options:
    • Java. Select this option if you are creating a Java library.
    • JavaScript. Select this option if you are creating a JavaScript library. Note that this option is not available at the project level.
    • From Maven. Select this option if you are going to download a Java library from a public Maven repository.
    • ActionScript/Flex. Select this option if you are creating an ActionScript/Flex library. This option is always present at the global level. A project ActionScript/Flex library can be created only if there is a Flash module in your project.
  4. If you are creating a Java, JavaScript or ActionScript/Flex library, the Select Library Files dialog opens. Select the files and folders that you want to be included in the library.

    If appropriate, the Detected Roots dialog is displayed showing potential library items. Use the check boxes to deselect the unnecessary items.

  5. If you have selected the From Maven option, the Download Library from Maven Repository is shown. Specify the artifact to be downloaded and the destination directory. (To search for the artifact, you can use a class name, a keyword or a search pattern, or Maven coordinates.) Optionally, select Sources and/or JavaDocs for the source code and documentation to be included.
  6. If you are creating a Java library, the Choose Modules dialog is shown. Select the modules in which the new library will be used.
  7. If you are creating an ActionScript/Flex library, the Choose Flash Build Configurations dialog is shown. Select the build configurations in which the new library will be used.
  8. If necessary, edit the library name and contents.
  9. For a JavaScript library, specify its usage scope.
  10. Click OK in the Project Structure dialog.
Adding items to a project or global library
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, click add. (For a JavaScript library, click add and select Attach Files or Directories.)
  5. In the dialog that opens, select the files and folders that you want to be included in the library, and click OK.
  6. Click OK in the Project Structure dialog.
Removing items from a project or global library
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, select the library items to be removed, and click delete.
  5. Click OK in the Project Structure dialog.
Specifying online documentation URL for a project or global library
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, click icon_doc_url. (For a JavaScript library, click add and select Specify Documentation URL instead.)
  5. In the dialog that opens, specify the documentation URL and click OK.
  6. Click OK in the Project Structure dialog.
Making items excluded in a project or global library
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, click rootExcluded.
  5. In the dialog that opens, select the items that you want to make excluded, and click OK. (You can exclude folders, archives (e.g. JARs) and folders within the archives.)
  6. Click OK in the Project Structure dialog.
Cancelling the excluded status of items in a project or global library
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, select the items whose excluded status you want to cancel. (The items with the excluded status are shown as rootExcluded.)
  5. Click delete.
  6. Click OK in the Project Structure dialog.
Creating a copy of a project or global library
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. Click copy.
  5. In the Copy Library dialog, specify the library name and click OK.
  6. Click OK in the Project Structure dialog.
Creating a copy of a global library at the project 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 of the dialog, select Global Libraries.
  3. In the pane to the right, right-click the library of interest and select Copy to Project Libraries.
  4. In the Copy Library dialog, specify the name of the library. If you want a copy of the library files to be created, select the Copy library files to check box and specify the corresponding location.
  5. Click OK in the Project Structure dialog.
Moving a project library to a global 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 of the dialog, select Libraries.
  3. In the pane to the right, right-click the library of interest and select Move to Global Libraries.
  4. In the Move Library dialog, if necessary, change the library name. If you want to change the location of the library files, select the Move library files to check box and specify the corresponding location.
  5. Click OK in the Project Structure dialog.
Adding a project or global library to module dependencies
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, right-click the library of interest and select Add to Modules.
  4. In the Choose Modules dialog, select the modules in which the library will be used, and click OK.
  5. Click OK in the Project Structure dialog.
Finding usages of a project or global library in a project
  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 of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. Click find.png.
Deleting project and global libraries
  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 of the dialog, select Libraries or Global Libraries.
  3. In the pane to the right, select the libraries to be deleted.
  4. Click delete.
  5. Click OK in the Project Structure dialog.

See Also

Concepts:

Procedures:

Reference:

Web Resources: