IntelliJ IDEA 2021.2 Help

Import and export projects

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.

    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 import or clone a 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 Gradle project, IntelliJ IDEA executes its build scripts, loads dependencies, and so on.

  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.

Export a project

You can save a project as a .zip archive or export it to Eclipse.

Save a project as a .zip file

  1. From the main menu, select File | Export | Project to Zip File.

  2. In the dialog that opens, specify the path to which you want to save the .zip file with the project and click Save.

Your project will be saved to the specified location as a .zip archive.

Last modified: 09 November 2021