IntelliJ IDEA 2020.2 Help

Import a project

Get a project from version control

  1. From the main menu, select VCS | Get from Version Control, or, if no project is currently opened, click Get from Version Control on the Welcome screen.

  2. In the Get from Version Control dialog, specify the URL of the remote repository you want to clone, or select one of the VCS hosting services on the left.

    If you are already logged in to the selected hosting service, completion will suggest the list of available repositories that you can clone.

    Getting a project from GitHub
  3. Click Clone. If you want to create a project based on the sources you have cloned, click Yes in the confirmation dialog. Git root mapping will be automatically set to the project root directory.

    If your project contains submodules, they will also be cloned and automatically registered as project roots.

  4. When you're importing or cloning the project for the first time, IntelliJ IDEA analyzes it. If the IDE detects more than one configuration (for example, Eclipse and Gradle), it prompts you to select which configuration you want to use.

    Select the necessary configuration and click OK.

    Dialog that prompts you to select how you want to import the project

    The IDE pre-configures the project according to your choice. For example, if you select Android Gradle project, IntelliJ IDEA adds the Android facet to the project during import with the tools for developing mobile applications for Android.

Open a project (simple import)

This option imports the selected project to IntelliJ IDEA as is (opens it). If you want to set custom settings while importing the project (for example, select another SDK or choose the libraries that you want to import), refer to Create a project from existing sources.

  1. Launch IntelliJ IDEA.

    If the Welcome screen opens, click Open or Import.

    Otherwise, from the main menu, select File | Open.

  2. In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.

  3. When you're importing or cloning the project for the first time, IntelliJ IDEA analyzes it. If the IDE detects more than one configuration (for example, Eclipse and Gradle), it prompts you to select which configuration you want to use.

    Select the necessary configuration and click OK.

    Dialog that prompts you to select how you want to import the project

    The IDE pre-configures the project according to your choice. For example, if you select Android Gradle project, IntelliJ IDEA adds the Android facet to the project during import with the tools for developing mobile applications for Android.

  4. If you have been working with another project, select whether you want to open the new project in a new dialog or in the current one.

Import a project with settings

Import a project from an external model

Use this type of import if your project comes from an external model and you want to import it as a whole. In this case, IntelliJ IDEA interprets the project files (for example, your Eclipse project will be migrated to IntelliJ IDEA).

  1. Launch IntelliJ IDEA.

    If the Welcome screen opens, press Ctrl+Shift+A, type project from existing sources, and click the Import project from existing sources action in the popup.

    Otherwise, from the main menu, select File | New | Project from Existing Sources.

    Importing a project from existing sources
  2. In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.

  3. Select the external model that your project uses:

    • Eclipse
    • Maven
    • Gradle or Android Gradle: select the necessary build tool and click Finish.

      For Maven and Gradle projects, the IDE configures the settings automatically. You will be able to adjust them after the project is imported.

    Importing a project from an external model

Create a project from existing sources

Use this type of import to create an IntelliJ IDEA project over the existing source code that is not necessarily an exported project.

  1. Launch IntelliJ IDEA.

    If the Welcome screen opens, press Ctrl+Shift+A, type project from existing sources, and click the Import project from existing sources action in the popup.

    Otherwise, from the main menu, select File | New | Project from Existing Sources.

    Importing a project from existing sources
  2. In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.

  3. Select the Create project from existing sources option and click Next.

    Creating a project from existing sources

  4. Specify the name and location and select a format for the new project. It's recommended that you use the directory-based format.

    Click Next.

    If you are importing the project to the same directory, the IDE asks you whether you want to overwrite it. If you click Yes, IntelliJ IDEA will overwrite the files in .idea directory and the .iml files, your source files will remain intact.

    A popup warning you that the folder will be overwritten
  5. Select the directories that you want to use as source root directories (folders with your source code) and click Next.

    Importing sources

  6. Select the libraries that you want to add to the new project.

    You can join several selected libraries or archives into a new library by clicking the Merge button or split the selected library into two by clicking the Split button.

    Click Next

    Importing libraries
  7. Review module structure: select the modules that you want to include in your project.

    You can merge several modules into one by clicking the Merge button or split the selected module into two by clicking the Split button.

    Click Next

  8. Specify the SDK that you want to use.

    If the necessary SDK is already defined in IntelliJ IDEA, select it from the list on the left. Otherwise, click the Add button and add a new SDK.

    Click Next.

    Importing SDK
  9. Enable support for the detected frameworks and technologies: select checkboxes next to the necessary items.

    You can also specify how the files-indicators should be grouped: by type (by framework) or by directory (by location).

  10. Click Finish.

Last modified: 07 July 2020