Installation
The current Gradle release is 6.7. You can download binaries and view docs for all Gradle versions from the releases page.
Prerequisites
Gradle runs on all major operating systems and requires only a Java JDK version 8 or higher to be installed. To check, run java -version :
Additional resources
- On-demand and live online training is available for free to Gradle users.
- Self-paced tutorials are a good place to try Gradle with a variety of languages in addition to the docs.
- Gradle has a new visual build inspection tool called build scans.
- Finally, the Gradle Newsletter is a great way to keep UP-TO-DATE , with issues crafted monthly.
Installing with a package manager
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix-based systems.
Homebrew is “the missing package manager for macOS”.
Other package managers are available, but the version of Gradle distributed by them is not controlled by Gradle, Inc. Linux package managers may distribute a modified version of Gradle that is incompatible or incomplete when compared to the official version (available from SDKMAN! or below).
› Additional helpful information
Installing manually
Step 1. Download the latest Gradle distribution
The current Gradle release is version 6.7, released on 14 Oct 2020. The distribution zip file comes in two flavors:
If in doubt, choose the binary-only version and browse docs and sources online.
Need to work with an older version? See the releases page.
Step 2. Unpack the distribution
Linux & MacOS users
Unzip the distribution zip file in the directory of your choosing, e.g.:
Microsoft Windows users
Create a new directory C:\Gradle with File Explorer.
Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-6.7 to your newly created C:\Gradle folder.
Alternatively you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.
Step 3. Configure your system environment
Linux & MacOS users
Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer ) icon, then click Properties -> Advanced System Settings -> Environmental Variables .
Under System Variables select Path , then click Edit . Add an entry for C:\Gradle\gradle-6.7\bin . Click OK to save.
Step 4. Verify your installation
Open a console (or a Windows command prompt) and run gradle -v to run gradle and display the version, e.g.:
› Additional helpful information
Upgrade with the Gradle Wrapper
If your existing Gradle-based build uses the Gradle Wrapper, you can easily upgrade by running the wrapper task, specifying the desired Gradle version:
Note that it is not necessary for Gradle to be installed to use the Gradle wrapper. The next invocation of gradlew or gradlew.bat will download and cache the specified version of Gradle.
› Additional helpful information
Older Releases
You can find all releases and their checksums on the releases page.
Command-Line Completion
Command-line completion scripts are available for bash and zsh. This provides completion for Gradle tasks and command-line options.
Как установить gradle на WINDOWS 10
Я пробовал некоторые пути с помощью пути, но он не работал, потому что, когда я редактирую путь в системных переменных, он открывает все пути, не похожие на учебные пособия, где я должен просто положить:% GRADLE_HOME%\bin в конце.
Загрузите Gradle и разархивируйте его туда, где вы хотите его установить.
Затем в Windows Search найдите «Система», а затем выберите: «Система» (панель управления)
Нажмите ссылку «Дополнительные системные настройки».
Выберите переменные среды
Затем нажмите кнопку «Создать» под пользовательской переменной и добавьте GRADLE_HOME в имя переменной и путь, указывающий на корневой каталог распакованных файлов из Gradle на значение переменной.
В разделе «Системные переменные» выберите «Путь» и нажмите кнопку «Изменить». В следующем окне нажмите кнопку «Создать» и добавьте путь к каталогу bin распакованных файлов из Gradle.
Если вы пользователь Scoop то Scoop будет лучшим вариантом для установки инструментов, которые вы знаете и любите. Scope — это просто установщик командной строки.
просто запустите эту команду scoop install gradle
Но сначала вам нужно установить scoop с помощью команды powershell
Примечание: если вы получаете сообщение об ошибке, вам может потребоваться изменить политику выполнения (т.е. включить Powershell) с помощью следующей команды
Загрузите Gradle и разархивируйте его туда, куда вы хотите его установить. Затем откройте окно переменных USER для вашего пользователя (аналогично тому, что вы показываете) и создайте переменную GRADLE_HOME с путем, указывающим на корневой каталог вашего загруженного дистрибутива Gradle. Затем добавьте его в PATH в переменных USER с помощью чего-то вроде:
Обратите внимание, что я добавил существующую переменную PATH к новой. Вы не хотите удалять то, что уже есть. Кроме того, ваше изображение показывает что-то еще, добавленное к пути. Вы хотите добавить это в строку выше, что-то вроде:
Так что это тоже не будет потеряно.
Это то, что я делал на Windows в течение многих лет. Другие варианты — использовать что-то вроде http://sdkman.io/; однако, это требует дополнительной работы в Windows, так как это действительно предназначено для операционных систем с реальным терминалом.
Если вы здесь, и ни один из этих ответов «не помог», попробуйте перезапустить программу оболочки. Я просто потратил больше часа, и мне просто пришлось перезапустить окно консоли, чтобы добиться цели.
Installing Gradle
You can install the Gradle build tool on Linux, macOS, or Windows. This document covers installing using a package manager like SDKMAN! or Homebrew, as well as manual installation.
Use of the Gradle Wrapper is the recommended way to upgrade Gradle.
You can find all releases and their checksums on the releases page.
Prerequisites
Gradle runs on all major operating systems and requires only a Java Development Kit version 8 or higher to run. To check, run java -version . You should see something like this:
Gradle ships with its own Groovy library, therefore Groovy does not need to be installed. Any existing Groovy installation is ignored by Gradle.
Gradle uses whatever JDK it finds in your path. Alternatively, you can set the JAVA_HOME environment variable to point to the installation directory of the desired JDK.
Installing with a package manager
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix-like systems (macOS, Linux, Cygwin, Solaris and FreeBSD). We deploy and maintain the versions available from SDKMAN!.
Homebrew is «the missing package manager for macOS».
Other package managers are available, but the version of Gradle distributed by them is not controlled by Gradle, Inc. Linux package managers may distribute a modified version of Gradle that is incompatible or incomplete when compared to the official version (available from SDKMAN! or below).
Installing manually
Step 1. Download the latest Gradle distribution
The distribution ZIP file comes in two flavors:
Complete (all) with docs and sources
Need to work with an older version? See the releases page.
Step 2. Unpack the distribution
Linux & MacOS users
Unzip the distribution zip file in the directory of your choosing, e.g.:
Microsoft Windows users
Create a new directory C:\Gradle with File Explorer.
Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-6.7 to your newly created C:\Gradle folder.
Alternatively, you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.
Step 3. Configure your system environment
To run Gradle, the path to the unpacked files from the Gradle website need to be on your terminal’s path. The steps to do this are different for each operating system.
Linux & MacOS users
Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:
Alternatively, you could also add the environment variable GRADLE_HOME and point this to the unzipped distribution. Instead of adding a specific version of Gradle to your PATH , you can add $GRADLE_HOME/bin to your PATH . When upgrading to a different version of Gradle, just change the GRADLE_HOME environment variable.
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer ) icon, then click Properties → Advanced System Settings → Environmental Variables .
Under System Variables select Path , then click Edit . Add an entry for C:\Gradle\gradle-6.7\bin . Click OK to save.
Alternatively, you could also add the environment variable GRADLE_HOME and point this to the unzipped distribution. Instead of adding a specific version of Gradle to your Path , you can add %GRADLE_HOME%/bin to your Path . When upgrading to a different version of Gradle, just change the GRADLE_HOME environment variable.
Verifying installation
Open a console (or a Windows command prompt) and run gradle -v to run gradle and display the version, e.g.:
You can verify the integrity of the Gradle distribution by downloading the SHA-256 file (available from the releases page) and following these verification instructions.
Next steps
Now that you have Gradle installed, use these resources for getting started:
Create your first Gradle project by following one of our step-by-step samples.
Sign up for a live introductory Gradle training with a core engineer.
Learn how to achieve common tasks through the command-line interface.
Configure Gradle execution, such as use of an HTTP proxy for downloading dependencies.
Subscribe to the Gradle Newsletter for monthly release and community updates.