<html><head><link rel="canonical" href="https://www.jetbrains.com/help/idea/gradle.html.md/" data-react-helmet="true"/></head><body># Gradle

&gt; **TL;DR**
&gt; Required plugins: Gradle, Gradle for Java ([installed](managing-plugins.html) and enabled by default)
&gt;
&gt;
&gt;
&gt; The Gradle versions' support: starting with the version 4.5.1 and later. Note that for the Gradle version less than 4.8 and Java version 11, there is an ongoing [Gradle issue](https://github.com/gradle/gradle/issues/8431).
&gt;
&gt;
&gt;
&gt; If you work in IntelliJ&nbsp;IDEA, you do not need to install Gradle separately; IntelliJ&nbsp;IDEA does it for you.

IntelliJ&nbsp;IDEA supports a fully functional integration with [Gradle](https://gradle.org) that helps you automate your building process. You can easily create a new Gradle project, open and sync an existing one, work with several [linked projects](#link_gradle_project) simultaneously, and manage them.

You can also create a Gradle project and store it in the WSL environment or open it from the WSL file system. For more information, refer to the [WSL](how-to-use-wsl-development-environment-in-product.html) section.

Procedure: Create a new Gradle project

1. Launch the [New Project wizard](new-project-wizard.html). If no project is currently opened in IntelliJ&nbsp;IDEA, click New Project on the welcome screen. Otherwise, select `File | New | Project` from the main menu.

2. Name the new project and change its location if necessary.

3. Select the Create Git repository to place the new project under version control.

You will be able to do it later at any time.

&gt; **Note:**
&gt; The `.gitignore` file is generated in any case.

4. Select a language that you want to use in your project. Click ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg) if you want to add other languages available via plugins.

5. Select Gradle in the list of Build system.

6. Specify project's SDK (JDK) or use the default one.

&gt; **Tip:**
&gt; If you don't have a JDK on your machine, IntelliJ&nbsp;IDEA can quickly [download the JDK](new-project-wizard.html) for you.
&gt;
&gt;
&gt;
&gt; The Gradle project sync will wait until the JDK is downloaded.

7. The selected Add sample code option will create a file with a basic code sample.

8. Select Gradle DSL. You can select Kotlin for the default syntax or Groovy as an alternative.

9. In Advanced Settings, specify the fields which resemble the [Maven coordinates](https://maven.apache.org/maven-conventions.html). These settings might be helpful if you decide to deploy your project to a Maven repository. The [fields](https://maven.apache.org/pom.html#Maven_Coordinates) you specify are added to the `build.gradle.kts` file.

* Gradle distribution: select [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) that is a default-preferable option or Local installation when you want to use the specific local Gradle version.

* Gradle version: if the wrapper option is selected, the latest Gradle distribution will be used unless you unselect the Auto-select option and select the specific version from the drop-down list. Alternatively, if the Local installation was selected then the version you defined locally is used.

* Auto-select: unselect this option to specify the Gradle version you want to use in your project.

* Use these settings for future projects: select this checkbox to use the configured Gradle version in your future projects.

* GroupId - `groupId`&nbsp;of the new project. You can omit this field if you plan to deploy your project locally.

* ArtifactId - `artifactId` that is added as a name of your new project.

* Version - `version`&nbsp;of the new project. By default, this field is specified automatically.

&gt; **Tip:**
&gt; For more information about Maven coordinates, refer to [Maven naming
&gt; conventions](https://maven.apache.org/guides/mini/guide-naming-conventions.html).

10. Click Create.

&gt; **Note:**
&gt; The newly created projects use JUnit 5.

Procedure: Create a Jakarta EE project with Gradle as a build tool

1. Launch the [New Project wizard](new-project-wizard.html). If no project is currently opened in IntelliJ&nbsp;IDEA, click New Project on the welcome screen. Otherwise, select `File | New | Project` from the main menu.

2. Under the Generators section, select Jakarta EE.

3. Configure your project selecting the appropriate options such as your project's name, location, language, and select Gradle as your build tool.

4. Click Create.

IntelliJ&nbsp;IDEA creates a Gradle project with the dedicated Gradle tool window and adds necessary dependencies.

For the more detailed information, refer to [Tutorial: Your first Jakarta EE application](creating-and-running-your-first-jakarta-ee-application.html).

Procedure: Open an existing Gradle project

&gt; **Note:**
&gt; If you have the [offline mode](jetgradle-tool-window.html#offline) enabled in your project, the opening or re-importing of the project might fail. To fix the issue, disable the offline mode and [re-import](work-with-gradle-projects.html#gradle_refresh_project) your project.

1. If no project is currently opened in IntelliJ&nbsp;IDEA, click Open on the welcome screen. Otherwise, select `File | Open` from the main menu.

If you have some custom plugins that require you to import your project from the IntelliJ&nbsp;IDEA model, press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)) and search for the Project from Existing Sources action.

2. In the dialog that opens, select a directory containing a Gradle project and click OK.

IntelliJ&nbsp;IDEA opens and syncs the project in the IDE.

If you need to adjust the Gradle settings options, refer to [Gradle settings](gradle-settings.html).

Procedure: Check Gradle JVM and language level

* Gradle JVM: when IntelliJ&nbsp;IDEA opens the Gradle project, it checks the `gradle.properties` file for the appropriate JVM version specified in `org.gradle.java.home` and uses it for the project. If it is not specified, then the project SDK is used. Alternatively, you can use the [Gradle settings](gradle-settings.html) to configure the Gradle JVM.

* Language level: the language level settings are applied for a source root or for a module. If a Gradle project has a single [linked project](#link_gradle_project) then the project default language level is set to the minimum language level among the module language levels. The module language level is set to `sourceCompatibility` in the `build.gradle.kts` file, in the `java` block.

The preview part is set to the conjunction of preview flags of the module source sets. The source set module language level is set to the corresponding combination of `sourceCompatibility` property and `--enable-preview` flag.

Procedure: Link a Gradle project to an IntelliJ&nbsp;IDEA project

You can have multiple Gradle projects inside one IntelliJ&nbsp;IDEA project. It might be helpful if you keep parts of code in different projects, have some legacy projects on which you need to work, have [Gradle composite build](work-with-gradle-projects.html#gradle_composite_build) or work with [microservices](https://microservices.io). You can link such projects in IntelliJ&nbsp;IDEA and manage them simultaneously.

When you [open](#gradle_import_project_start) a Gradle project, the link of the project is established automatically and the Gradle tool window is enabled.

If an IntelliJ&nbsp;IDEA project is not linked to a Gradle project, then the Gradle tool window is disabled. In this case, IntelliJ&nbsp;IDEA displays a message with a link that quickly lets you reimport your Gradle project and enable the Gradle tool window. If the Gradle tool window is active, then you have at least one Gradle project linked.

1. Open the Gradle tool window.

2. In the Gradle tool window, click ![the Link Gradle Project icon](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg) to attach a Gradle project.

3. In the dialog that opens, select the desired `build.gradle` file, and click OK.

4. In the Import Module from Gradle window, specify options for the Gradle project that you are trying to link and click OK.

The project is linked. The Gradle tool window shows the toolbar and a tree view of Gradle entities.

If you need to link back the previously [unlinked project](work-with-gradle-projects.html#ignore_detach_gradle_project), in the Project tool window, right-click the added `build.gradle.kts` or if it is a Gradle Groovy module the `build.gradle` file and select Import Gradle Project.

Procedure: Add a new Gradle module to an existing Gradle project

You can add a Gradle module to a project in which you are already working.

1. In the main menu, go to `File| New | Module` to open the New Module wizard .

2. If the existing project is not the Gradle project then the process of adding a module is the same as [Creating a new Gradle project](#gradle_create_project). If the existing project is a Gradle project, then the process of adding a new module is shorter. You need to specify the name of your module in the ArtifactId field. The rest of the information is added automatically, and you can use either the default settings or change them according to your preferences. Also, note that Add as module to field, by default, displays the name of your project to which you are trying to add a module. You can click ![Add module](https://resources.jetbrains.com/help/img/idea/2026.2/app.nodes.Module.svg) to select a different name if you have other linked Gradle projects.

Procedure: Convert a regular project into a Gradle project

1. Open your project in IntelliJ&nbsp;IDEA.

2. In the Project tool window, right-click the name of your project and select `New | File`.

3. In the dialog that opens enter `build.gradle` and click OK.

4. Open the `build.gradle` file in the editor, add the information you need and re-open your project. The following minimal information should be included in the project's build script file:

```KOTLIN
plugins {
    java
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

sourceSets {
    main {
        java {
            setSrcDirs(listOf("src"))
        }
    }
}

dependencies {
    testImplementation(platform("org.junit:junit-bom:5.10.0"))
    testImplementation("org.junit.jupiter:junit-jupiter")
}

tasks.test {
    useJUnitPlatform()
}

```

As soon as you create a `build.gradle.kts` file, IntelliJ&nbsp;IDEA recognizes the Gradle build script and displays a notification suggesting to load the project as Gradle. After you load the project, IntelliJ&nbsp;IDEA enables the Gradle tool window.

We also recommend that you add the `settings.gradle.kts` file to your project and add `rootProject.name = "projectName"` to it. Where `"projectName"` would be the name of your project.

Procedure: Access the Gradle settings

Use the [Gradle settings](gradle-settings.html) to configure the build and run actions for each linked Gradle project, a Gradle version, importing of the project's changes, and so on.

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) , go to `Build, Execution, Deployment| Gradle`.

![Gradle settings](https://resources.jetbrains.com/help/img/idea/2026.2/gradle_settings_preferences.png)

&gt; **Tip:**
&gt; Click ![Gradle Settings](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.settings.svg) on the toolbar, in the Gradle tool window to access the Gradle settings.

2. On the Gradle settings page, configure the available options and click OK to save the changes.

Procedure: Configure a Gradle version for a project

IntelliJ&nbsp;IDEA lets you use different options to configure a Gradle version for your Gradle project. You can use the default Gradle wrapper, use a Gradle wrapper as a task, or configure a local Gradle distribution.

1. Select ![the Gradle settings icon](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.settings.svg) in the Gradle tool window to quickly access the Gradle settings page.

![Gradle settings](https://resources.jetbrains.com/help/img/idea/2026.2/gradle_settings_use_gradle_from.png)

2. In the Distribution list select one of the following options:

* Wrapper: this is a recommended default option that uses [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). In this case you delegate the update of Gradle versions to Gradle and get an automatic Gradle download for the build. This option also lets you build with a precise Gradle version. The Gradle version is saved in the `gradle-wrapper.properties` file in the `gradle` directory of your project and helps you eliminate any Gradle version problems.

* Wrapper task: select this option to configure a Gradle wrapper according to the `wrapper` task configuration. It might be convenient if you prefer to control which Gradle version to use in the project. If you used the default Gradle wrapper option and then switched to the Gradle `wrapper` task configuration, changes you made in the task automatically update during the project import.

* Local installation: select this option if you want to manually download and use a specific Gradle version. Specify the location of your Gradle installation and JVM under which IntelliJ&nbsp;IDEA will run Gradle when you import the specified Gradle project and when you execute its tasks.

Click OK to save the changes.

Procedure: Add VM options for the Gradle project

You can specify VM options for your Gradle project using the `gradle.properties` file.

1. [Create](#gradle_create_project) or [open](#gradle_import_project_start) your Gradle project.

2. In the Project tool window, right-click the project and from the context menu, select `New | File`.

3. In the New File dialog, enter `gradle.properties` as a filename and click OK.

4. Open the created file in the editor and add the VM options you need.

![the gradle.properties file](https://resources.jetbrains.com/help/img/idea/2026.2/gradle_vm_options.png)

For more information, refer to the [Gradle documentation](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties).

Procedure: Increase daemon heap size

You can adjust the existing Gradle daemon heap size for your project using the `gradle.properties` file.

1. [Create](#gradle_create_project) or [open](#gradle_import_project_start) your Gradle project.

2. In the Project tool window, right-click the project and from the context menu, select `New | File`.

3. In the New File dialog, enter `gradle.properties` as a filename and click OK.

4. Open the created file in the editor and specify the needed daemon size using the `org.gradle.jvmargs=(JVM arguments)` property.

The default size is `-Xmx512m "-XX:MaxMetaspaceSize=256m"`.

Check the following code snippet as a syntax example:

```
org.gradle.jvmargs=-Xmx4096m
```

For more information, refer to the [Gradle documentation](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties).

## Configure Gradle Daemon toolchains

Starting with Gradle version 8.8, IntelliJ&nbsp;IDEA supports the Gradle Daemon toolchain, which helps speed up builds and manage project JDKs. Also, starting with IntelliJ&nbsp;IDEA version 2025.1, this support is available by default.

You can either create a new project with the daemon toolchain or add the support to the already existing project.

Procedure: Configure Gradle Daemon toolchain for a new project

1. Open the IDE and press `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (NetBeans), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) twice to open the search window.

2. Type Registry to open the Registry tool window and select the `gradle.daemon.jvm.criteria.new.project` option.

3. [Create a new Gradle project](#project_create_gradle).

IntelliJ&nbsp;IDEA creates a project that contains the `gradle-daemon-jvm.properties` file inside the `gradle` directory with the project JDK information.

&gt; **Note:**
&gt; For Gradle versions 8.9 and later, the specified JDK information in the `gradle-daemon-jvm.properties` file is automatically reflected in the [Gradle settings](gradle-settings.html#tool_chain).

4. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))  to open settings and then select `Build, Execution, Deployment | Build Tools | Gradle`.

5. In the Gradle section, you can manage JDKs and choose the one you need for your project using Gradle JVM Criteria.

![Gradle projects settings](https://resources.jetbrains.com/help/img/idea/2026.2/gradle_projects_settings.png)

6. In the list of Version, select the necessary version, and you can also choose Vendor inside the Advanced Settings section.

7. Click OK to save the changes.

Procedure: Configure Gradle Daemon toolchain for the existing project

1. Open your Gradle project.

2. In the Project tool window, right-click the `gradle` directory and select `New | File`.

3. In the window that opens, add the `gradle-daemon-jvm.properties` file.

4. Open `gradle-daemon-jvm.properties` in the editor and add Gradle JVM version and vendor.

Check the following example:

```
toolchainVendor=ibm
toolchainVersion=19
```

5. Click ![the Synchronize icon](https://resources.jetbrains.com/help/img/idea/2026.2/gradle.icons.gradleLoadChanges.svg) (Sync Gradle Changes) in the editor to synchronize the changes with your project.

6. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))  to open settings and then select `Build, Execution, Deployment | Build Tools | Gradle`.

7. In the Gradle section, you can manage JDKs and choose the one you need for your project using Gradle JVM Criteria.

![Gradle projects settings](https://resources.jetbrains.com/help/img/idea/2026.2/gradle_projects_settings.png)

8. In the list of Version, select the necessary version, and you can also choose Vendor inside the Advanced Settings section.

9. Click OK to save the changes.

## See also

### Language and Framework-Specific Guidelines

[Groovy](groovy.html)

### Procedures

[Gradle projects](work-with-gradle-projects.html)

### External Links

[Gradle](https://gradle.org/)

</body></html>