IntelliJ IDEA 2017.2 Help

Creating a Project by Importing Existing Sources

Overview

You can create a project by importing a collection of sources available on your computer. Such a collection, in addition to source files, may also include library, configuration, image and other files.

You can import the sources that come from Bnd/Bndtools, Eclipse, Flash Builder, Gradle, or Maven. In such cases the sources are accompanied with corresponding project metadata and you can use that metadata as a source of import. This way of importing in the UI is referred to as importing from an external model.

You can also import the sources of "unspecified origin". In such cases the sources are treated generically and are referred to in the UI simply as existing sources. You may want to use this way of importing if:

  • The sources come from the systems other than Bnd/Bndtools, Eclipse, Flash Builder, Gradle, or Maven.
  • For some reason, you don't want to use the Bnd/Bndtools, Eclipse, etc. project metadata as the source of import.

In technical terms, importing is just creating IntelliJ IDEA project and module definition files in corresponding locations. (IntelliJ IDEA will create a project with one or more modules.) In most of the cases, the "original" sources will stay where they are.

Creating a project by importing the sources from Bnd/Bndtools, Eclipse, Flash Builder, Gradle, or Maven

  1. If no project is currently open in IntelliJ IDEA, click Import Project on the Welcome screen. Otherwise, select File | New | Project from Existing Sources.
  2. In the dialog that opens, select the directory or file which you want to use as a source of import. This may be a directory that contains the corresponding collection of sources or a file that appropriately describes such a collection. (The possible choices are listed right in the dialog.) Click OK.

    As a result, the Import Project wizard opens.

  3. On the first page of the wizard, specify the origin of the sources. (This page is not shown if IntelliJ IDEA has guessed what you are importing.) Select Import project from external model, and select Bnd/Bndtools, Eclipse, Flash Builder, Gradle, or Maven. Click Next.

The next steps depend on the origin of the sources that you are importing. For corresponding instructions, see:

Creating projects by importing the sources of unspecified origin

  1. If no project is currently open in IntelliJ IDEA, click Import Project on the Welcome screen. Otherwise, select File | New | Project from Existing Sources.
  2. In the dialog that opens, select the directory which contains the collection of sources you want to import. Click OK.

    As a result, the Import Project wizard opens.

  3. On the first page of the wizard, select Create project from existing sources and click Next.
  4. On the next page of the wizard, specify the name and location of the project to be created. Note that the folder specified in the Project location field should contain the sources that you are importing. IntelliJ IDEA will try to sort out the files contained in this folder. Click Next.
  5. The next page of the wizard shows the directories in which source files are found. Potentially, these directories may be your source root directories.

    Select the directories which you want to include in your project as the source root directories and click Next.

  6. On the next page of the wizard, select and configure the libraries to be included in your project. Click Next.
  7. On the next page of the wizard, select and configure the modules to be included in your project. Click Next.
  8. On the next page of the wizard, specify the SDK to be used in your project and click Next.
  9. The next page of the wizard shows the frameworks and technologies detected in your sources. Select the ones that you want to be enabled and click Finish.
Last modified: 29 November 2017

See Also