- In the dialog that opens, select the directory that contains the project to be imported, or a file that contains an appropriate project description. Click OK.
- On the first page of the Import Project wizard, select Gradle, and click Next. (This page is not shown if IntelliJ IDEA has guessed what you are importing.)
- On the Gradle settings page of the wizard, specify the paths to the Gradle project you want to import,
and the path to your Gradle installation.
Note that if you have specified Gradle home as a system environment variable, or if you have defined Gradle home for a template project, this setting will be automatically deduced by IntelliJ IDEA.
In this case, the field Gradle home is not editable. However, you can override the deduced value by pressing the browse button and choosing a different Gradle location.
Click Next. IntelliJ IDEA builds project information on the base of the existing sources.
- In the project structure page of the wizard, change or review settings.
Note that the project level and module level settings are editable. On the project level, you can change project name, language level, and project compiler output; on the module level - module name and compiler settings (refer to the sections Project. General Settings Page and Paths Tab for details.
On the level of the content roots, the fields are not editable. You can review settings for the content roots.
- Click Finish. The imported project is created and opened in the specified frame of IntelliJ IDEA.
Once a Gradle project is imported, IntelliJ IDEA makes it possible to modify external Gradle model and IntelliJ IDEA project, and explore differences between them. Refer to the section Synchronizing Changes in Gradle Project and IntelliJ IDEA Project.