Gradle install on linux

Содержание
  1. Как установить Gradle в Ubuntu 20.04 | 18.04
  2. Как установить Gradle в Ubuntu 20.04 | 18.04
  3. Шаг 1. Установите Java JDK
  4. Шаг 2: установите Gradle
  5. Шаг 3. Настройте переменные среды Ubuntu
  6. Installation
  7. Prerequisites
  8. Additional resources
  9. Installing with a package manager
  10. › Additional helpful information
  11. Installing manually
  12. Step 1. Download the latest Gradle distribution
  13. Step 2. Unpack the distribution
  14. Step 3. Configure your system environment
  15. Step 4. Verify your installation
  16. › Additional helpful information
  17. Upgrade with the Gradle Wrapper
  18. › Additional helpful information
  19. Older Releases
  20. Command-Line Completion
  21. Как установить Gradle в Ubuntu 20.04
  22. Подготовка
  23. Установка OpenJDK
  24. Скачивание Gradle
  25. Настройка переменных среды
  26. Проверка установки Gradle
  27. Выводы
  28. Installing Gradle
  29. Prerequisites
  30. Installing with a package manager
  31. Installing manually
  32. Step 1. Download the latest Gradle distribution
  33. Step 2. Unpack the distribution
  34. Linux & MacOS users
  35. Microsoft Windows users
  36. Step 3. Configure your system environment
  37. Linux & MacOS users
  38. Microsoft Windows users
  39. Verifying installation
  40. Next steps
  41. КАК УСТАНОВИТЬ Gradle НА UBUNTU 18.04 / UBUNTU 16.04
  42. Предпосылки
  43. 1. Установите OpenJDK
  44. 2. Скачайте Gradle
  45. 3. Настройка переменных среды
  46. 4. Проверьте установку Gradle
  47. Заключение

Как установить Gradle в Ubuntu 20.04 | 18.04

Как установить Gradle в Ubuntu 20.04 | 18.04

Это краткое руководство показывает студентам и новым пользователям, как установить Gradle в Ubuntu 20.04 | 18.04.

Gradle — это система автоматизации сборки с открытым исходным кодом, которая помогает разработчикам эффективно автоматизировать, создавать и доставлять программное обеспечение, это улучшает концепции Apache Ant и Apache Maven и использует язык стиля Groovy вместо XML, в отличие от своих предшественников.

Gradle также работает со многими популярными платформами IDE, доступными сегодня, включая Android Studio, Eclipse, IDEA и NetBeans.

Чтобы узнать больше о Gradle, посетите его домашнюю страницу ..

Чтобы приступить к установке Gradle в системах Ubuntu, выполните следующие действия:

Шаг 1. Установите Java JDK

Gradle требует установки Java JDK на Ubuntu … Для этого требуется Java JDK 7 и выше … однако Java JDK 8 намного более стабильна и поддерживается на многих платформах … В этом руководстве мы собираемся установить OpenJDK 8 на Ubuntu ..

Чтобы установить OpenJDK 8, выполните следующие команды:

После этого выполните приведенные ниже команды, чтобы распечатать установленную версию Java:

Вы должны увидеть подобное содержимое, как показано ниже:

Шаг 2: установите Gradle

Теперь, когда OpenJDK 8 установлен, выполните приведенные ниже команды, чтобы загрузить Gradle версии 4.10.2 в / tmp… На момент написания этой статьи это была версия 4.10.2.

После этого извлеките содержимое в каталог /opt

sudo unzip -d /opt/gradle /tmp/gradle-*.zip

Gradle следует распаковать в каталог /opt/gradle/gradle-4.10.2… Вы захотите сохранить версию отдельно, чтобы вы могли легко обновляться… В будущем все, что вам нужно сделать, это создать символическую ссылку на папку версии использовать эту версию.

Шаг 3. Настройте переменные среды Ubuntu

Теперь, когда вы извлекли содержимое Gradle, перейдите и настройте переменные среды Ubuntu для использования Gradle … Вы можете сделать это, выполнив приведенные ниже команды, чтобы создать новый файл с именем gradle.sh в каталоге /etc/profile.d .

sudo nano /etc/profile.d/gradle.sh

Они копируют и вставляют строки ниже в файл и сохраняют.

Когда вы закончите, выполните следующие команды, чтобы сделать файл исполняемым:

Вы должны иметь возможность использовать Gradle в Ubuntu … Чтобы распечатать версию Gradle и информационный лист, выполните следующие команды

Это должно распечатать его информацию, как показано ниже:

Вывод:

В этом посте показано, как установить Gradle на Ubuntu 20.04 | 18.04. Если вы обнаружите ошибку выше, оставьте комментарий в форме ниже и сообщите.

Источник

Installation

The current Gradle release is 7.2. 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 :

Читайте также:  Удаленный сервер для windows

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 visual build inspection tool: Build Scan™.
  • 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 7.2, released on 17 Aug 2021. 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-7.2 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-7.2\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 в Ubuntu 20.04

Gradle — это универсальный инструмент, используемый для создания, автоматизации и доставки программного обеспечения. В основном он используется для проектов Java, C ++ и Swift.

Gradle сочетает в себе лучшие возможности Ant и Maven . В отличие от своих предшественников, которые использовали XML для написания сценариев, Gradle использует Groovy , динамический объектно-ориентированный язык программирования для платформы Java, чтобы определять проект и создавать сценарии.

В этом руководстве объясняется, как установить Gradle в Ubuntu 20.04. Мы загрузим последнюю версию Gradle с их официального сайта.

Читайте также:  Что такое dvr windows 10 как отключить

Подготовка

В инструкциях предполагается, что вы вошли в систему как пользователь root или пользователь с привилегиями sudo .

Установка OpenJDK

Gradle требует, чтобы на компьютере была установлена Java SE 8 или новее.

Введите следующие команды для установки OpenJDK 11 :

Проверьте установку Java, распечатав версию Java :

Результат должен выглядеть примерно так:

Скачивание Gradle

На момент написания этой статьи последняя версия Gradle — 6.5.1 . Прежде чем перейти к следующему шагу, проверьте страницу выпусков Gradle, чтобы узнать, доступна ли более новая версия.

Загрузите zip-файл Gradle, содержащий только двоичный файл, в каталог /tmp с помощью следующей команды wget :

По завершении загрузки распакуйте файл в каталог /opt/gradle :

Gradle регулярно обновляется исправлениями безопасности и новыми функциями. Чтобы иметь больший контроль над версиями и обновлениями, мы создадим символическую ссылку с именем latest , которая указывает на каталог установки Gradle:

Позже, при обновлении Gradle, распакуйте более новую версию и измените символическую ссылку, чтобы она указывала на нее.

Настройка переменных среды

Нам нужно добавить каталог bin Gradle в системную PATH среды PATH . Для этого откройте текстовый редактор и создайте новый файл с именем gradle.sh внутри каталога /etc/profile.d/ .

Вставьте следующую конфигурацию:

Сохраните и закройте файл. Этот сценарий будет получен при запуске оболочки.

Загрузите переменные среды в текущий сеанс оболочки, используя source команду:

Проверка установки Gradle

Чтобы проверить правильность установки Gradle, используйте команду gradle -v которая отобразит версию Gradle:

Вы должны увидеть что-то вроде следующего:

Вот и все. Вы установили последнюю версию Gradle в свою систему Ubuntu и можете начать ее использовать.

Выводы

Мы показали вам, как установить Gradle в Ubuntu 20.04. Теперь вы можете посетить официальную страницу документации Gradle и узнать, как начать работу с Gradle.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Источник

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.

Читайте также:  Windows не видит 2tb

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-7.2 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-7.2\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.

Источник

КАК УСТАНОВИТЬ Gradle НА UBUNTU 18.04 / UBUNTU 16.04

Gradle – это универсальный инструмент сборки, используемый в основном для проектов Java. Он сочетает в себе лучшие черты Ant и Maven.

Gradle использует Groovy вместо использования XML для сценариев.

В этом уроке мы покажем вам, как установить последнюю версию Gradle на Ubuntu 18.04 LTS / Ubuntu 16.04 LTS.

Предпосылки

Вы должны войти в систему как пользователь с правами sudo, чтобы установить Gradle

1. Установите OpenJDK

– Gradle требует установки Java JDK или JRE версии 7 или выше. Используйте приведенную ниже команду для установки OpenJDK 8.

– Чтобы убедиться, что Java был успешно установлен, выполните следующую команду:

2. Скачайте Gradle

– Чтобы загрузить последнюю версию Gradle, посетите страницу релизов Gradle.

Используйте команду wget для загрузки zip-файла Gradle в каталог / tmp:

– После завершения загрузки распакуйте zip-файл в каталог /opt/gradle:

3. Настройка переменных среды

– Чтобы настроить переменную среды PATH для включения каталога Gradle bin, создайте новый файл с именем gradle.sh внутри каталога /etc/profile.d/, как показано ниже.

– Загрузите переменные среды, используя следующую команду:

4. Проверьте установку Gradle

– Чтобы проверить, правильно ли установлен Gradle, используйте команду gradle -v, которая отобразит версию Gradle:

Заключение

Вы успешно установили Gradle на Ubuntu 18.04 LTS / Ubuntu 16.04 LTS.

Источник

Оцените статью