A Gradle build defines where a Java project's code lives, which libraries it needs, and which tasks it can run. On the Linux desktop, IntelliJ IDEA imports that build model so the project's Gradle tasks are available inside the IDE.
The Gradle Wrapper gives everyone working on the project the same Gradle release. The first sync may need network access to download that release and fetch dependencies from the repositories declared in the build.
The JDK that runs Gradle can differ from the Java version the project targets. The wrapper's Gradle release determines which JDK versions can run the sync.
Steps to import a Gradle project into IntelliJ IDEA:
Start with no project open so IntelliJ IDEA opens on its Home screen. The main menu is under the Main Menu button in the window header, as in a new installation. Use a local Java project from a source you trust. Gradle can run the project's build scripts and plugins as your user during sync, which can start as soon as a trusted project opens. Have a compatible JDK installed and use a project with a Gradle Wrapper, a root build script that applies the Java plugin, and a declared dependency. The pictures use ~/IdeaProjects/reading-list and show the result in the Build and Gradle tool windows.
- Launch IntelliJ IDEA from the app grid if the IDE is closed.

- Click Open under Projects and Files on IntelliJ IDEA Home.

- Enter the full path to your Gradle project root in Open File or Project, replacing any existing value.
The root contains
settings.gradleorsettings.gradle.ktsand the Gradle Wrapper. The pictured path is/home/reader/IdeaProjects/reading-list. - Click OK in Open File or Project.
If IntelliJ IDEA opens a previously trusted project without a trust prompt, continue to step 6.
- Click Trust Project if the prompt names your project, you trust its source, and the folder-wide trust checkbox is clear.
The pictured Trust all projects in 'IdeaProjects' folder checkbox extends approval to every project in the parent folder. Stop at the prompt if the project name or source is unfamiliar.
- Click Main Menu in the window header.
If Air or Junie's Accept and Install offer appears in the editor, you can leave it on screen and continue to step 7.
- Point to View in the main menu.

- Point to Tool Windows in the View menu.

- Select Build from the Tool Windows submenu.

- Click the Sync tab in the Build tool window.

- Wait for a green check and finished beside your project on the Sync tab.
If New Minor Gradle Version Available appears under the finished result, you can leave it there and continue to step 12. If sync fails with a Java version error, the Gradle compatibility matrix lists which Java versions can run the release pinned in
gradle/wrapper/gradle-wrapper.properties. - Open Gradle with the elephant button on the right sidebar if the tool window is closed.

- Expand Tasks under your project in the Gradle tool window if the node is collapsed.

- Expand the build group under Tasks if the group is collapsed.

- Verify that your project shows individual tasks under Tasks > build in the Gradle tool window.
The pictured
reading-listproject listsassembleandbuildamong its tasks.