Java is undoubtedly one of the most popular programming languages ever to grace the face of the planet, powering millions of applications both on Linux and Windows platforms.
Java comprises of JRE (Java Runtime Environment) and JDK (Java Development Toolkit). JRE is a set of software applications that help in the deployment of Java applications. JDK is a development environment necessary for the building and compilation of Java applications.
Recommended Read: 6 Best Arch Linux Based User Friendly Distributions of 2019
In this tutorial, we are going to take you through a step by step of how you can install Java on Arch Linux.
Step 1: Check If Java is Installed
To begin with, let’s check if Java is installed in the Arch Linux using the following command.
$ java -version OR $ which java
From the output above, it evident that Java is missing. Let’s now proceed and install both JRE and JDK which both constitute JAVA.
Step 2: Install JRE in Arch Linux
To install JRE (Java Runtime Environment), a first search which versions are available for download using the command.
$ sudo pacman -sS java | grep jre
To install the latest version of JRE, run the command.
$ sudo pacman -S jre-openjdk
Y and hit ENTER to proceed with the installation of JRE and other dependencies.
Step 3: Install JDK in Arch Linux
With JRE installed, we can proceed to install JDK on our Arch Linux system. Once again, let’s search for the versions of JDK that are available for download.
$ sudo pacman -sS java | grep jdk
The first option is usually the latest version, so to install the latest JDK, run the command.
$ sudo pacman -S jdk-openjdk
As shown before, press
Y when prompted and hit ENTER to continue with the installation process. This will take a bit more of your time, so some patience will do.
At this point, we have successfully installed JAVA on our Arch Linux system.
To verify that JAVA has indeed been installed, run.
$ java -version $ which java
In this article, we demonstrated how you can install Java on Arch Linux. You can now proceed and install applications such as Apache Tomcat, Maven, Jenkins, and Gradle.