Как удалить gradle ubuntu

Обновлено: 04.07.2024

The current Gradle release is 7.3. 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 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.3, released on 09 Nov 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.3 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.3\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.

In this tutorial you will learn how to update and install gradle On Ubuntu 16.04 Lts? Learn how to uninstall and completely remove the package gradle from Ubuntu 16.04 LTS Operating System.

Quick installation of gradle:

Step 1: Update system:

Step 2: Install: gradle

Ater updaing the OS run following command to install the packae:

How to install gradle on Ubuntu 16.04?

How to install gradle On Ubuntu 16.04 Lts? Uninstall and remove gradle Package

First of all update your system with the command:

Above command will download the package lists for Ubuntu 16.04 on your system. This will update the list of newest versions of packages and its dependencies on your system.

After downloading the latest package list with the help of above you can run the installation process.

If gradle is not installed on your compter then the command 'dpkg -L gradle' will give followin error.

After system update use the following command to install gradle:

Above command will confirm before installing the package on your Ubuntu 16.04 Operating System. If you are not already logged in as su, installer will ask you the root password. After completion of the installation you can use the package on your system.

How to uninstall/remove gradle from Ubuntu 16.04?

Now we will see the commands for uninstalling the gradle from Ubuntu 16.04. For uninstalling this package you can easily use the apt command and remove the package from Linux Operating System.

To remove the gradle following command is used:

Following command is used to remove the gradle package along with its dependencies:

This will remove gradle and all its dependent packages which is no longer needed in the system.

Completely removing gradle with all configuration files:

Following command should be used with care as it deletes all the configuration files and data:

or you can use following command also:

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-7.3 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.:

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

Under System Variables select Path , then click Edit . Add an entry for C:\Gradle\gradle-7.3\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.

Subscribe to the Gradle Newsletter for monthly release and community updates.

How do I upgrade to Gradle 4.x? Preferably, with umake rather than SDKMAN! which seems to be what they suggest.

(I don't want to update all the packages due to a slow connection.)


2,681 1 1 gold badge 22 22 silver badges 26 26 bronze badges 4,203 13 13 gold badges 68 68 silver badges 138 138 bronze badges

3 Answers 3

You could use the ppa for the almost-always latest version

or SDKMAN for the latest version

Advantages of the ppa

  • auto-updates with the system
  • no piping of downloaded scripts to the shell

Advantages of sdkman: latest version supplied by gradle themselves.


2,681 1 1 gold badge 22 22 silver badges 26 26 bronze badges I got error while running upgrade gradle as The following packages have unmet dependencies. powershell : Depends: liblttng-ust0 but it is not installed . I have to run this sudo apt-get -f install then sudo apt-get -f install gradle . This way, it deletes the previous one and installs the latest from scratch. @AnumSheraz: powershell is in another repository altogether. It should not have anything to do with gradle. But it seems like sudo apt-get -f install fixed its problem. @naXa: if you really need the very latest, see the update. You will miss out on automatic updates.

You can also tell Gradle to update itself using a Gradle wrapper.

First you create the wrapper, then tell it to use the Gradle version of your choice:

Now this project will use Gradle 4.9, independent of what's installed. However, you need to remember to run Gradle through the wrapper, i.e., run ./gradlew instead of plain gradle .

The wrapper allows you to have different projects using different Gradle versions easily.

When you commit the created wrapper to source control, everybody who checks out the project will use the same Gradle version. This can help a lot with incompatible build scripts, when something has changed between Gradle versions.

Читайте также: