- If no project is currently open in IntelliJ IDEA, click Import Project on the Welcome screen. Otherwise, select File | Import Project.
- 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 next page of the wizard, specify Gradle project settings. You can select from the following options:
- Use auto-import - select this check box to resolve all the changes made to the Gradle project automatically every time you refresh your project.
- Use default gradle wrapper (recommended) - select this option to use Gradle wrapper. Using Gradle wrapper lets you get automatic Gradle download for the build. It also lets you build with the precise Gradle version.
- Use local gradle distribution - select this option to run local build scripts.
- Gradle home - in this text field, specify the fully qualified path to your Gradle installation.
If Gradle location has been defined by the environment variables GRADLE_HOME or PATH, then IntelliJ IDEA deduces this location, and suggests this path as the default value.
If Gradle location has not been deduced from the environment variables, specify it manually, or click the Browse button, and select the desired directory in the dialog that opens. Note that the value entered in this field takes preference over the environment variables.