How to Install Gradle on FreeBSD Latest
In this tutorial, we will guide you through the steps required to install Gradle on FreeBSD Latest.
Prerequisites
Before we start, please make sure your FreeBSD system is up-to-date by running the following command:
sudo pkg update && sudo pkg upgrade
Install OpenJDK
First, we need to install OpenJDK, which is required by Gradle. Run the following command:
sudo pkg install openjdk11
Install Gradle
Once OpenJDK is installed, we can proceed to install Gradle.
- Download the latest version of Gradle from the official website at http://gradle.org/ into the
/optdirectory with the following command:
sudo mkdir /opt/gradle
cd /opt/gradle
sudo curl -L https://services.gradle.org/distributions/gradle-x.x.x-bin.zip -o gradle-x.x.x-bin.zip
Note: Replace x.x.x with the version number you have downloaded.
- Unzip the downloaded file using the following command:
sudo unzip gradle-x.x.x-bin.zip
- To set the environment variable, open the
/etc/profilefile in any text editor using the following command:
sudo nano /etc/profile
- Append the following lines to the end of the file:
export GRADLE_HOME=/opt/gradle/gradle-x.x.x
export PATH=$PATH:$GRADLE_HOME/bin
Save and close the file.
To apply the changes, run the following command:
source /etc/profile
Test Gradle
To test that Gradle has properly installed, run the following command:
gradle --version
You should see the version number displayed in your terminal.
Congratulations! You have successfully installed Gradle on FreeBSD Latest.