Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to Install Java on Arch Linux?

  • Last Updated : 05 Oct, 2021

Java is one of the most popular programming languages. Today, many applications are using Java. Java consists of JRE (Java Runtime Environment) and JDK (Java Development Toolkit).JRE is the  Java Runtime Environment which is provided libraries to run and compile Java programs. JDK provides the compiler(javac) to compile the Java programs and other tools.

Procedure:

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

Now let’s see how to install the JAVA on Arch Linux.

  1. Check if Java is installed on the system
  2. Install JRE in Arch Linux
  3. Install JDK in Arch Linux
  4. Verify the Java is installed or Not

Now let us discuss these steps in detail with commands to be used along with visual aids for better interpretation which are as follows:



Step 1: Check if java is installed on the system

First, we must check that java is installed or not on the system. And check which version is installed on the Arch Linux system. So to check the java is installed or not, we can use the following command as follows:

java --version

If the above command gives output as the command is not found, then Java is not installed on the Arch Linux system. Otherwise, you will see which version of JDK and JRE is installed.

 Step 2: Install JRE in Arch Linux

Now we have to install the JRE package on the system. So first we will search which versions are available to download. To search for available JRE versions to download, use the following command as follows:

sudo pacman -sS java | grep jre

Now we are going to install the latest version of JRE. To install the latest version of JRE, use the following command as follows:



sudo pacman -S jre-openjdk

After running the above command it will ask to proceed with installation or not then simply press y key. Now you have successfully installed the JRE.

 Step 3: Install JDK in Arch Linux

Now we have to install the JDK on the system. First, let’s check available versions to download using the following command as follows:

sudo pacman -sS java | grep jdk

Now we have to install the latest version of the JDK. To install the latest version of JDK run the following command as follows:

sudo pacman -S jdk-openjdk

After running the above command, it will ask to continue or not, then press y key. Now we have successfully installed it on the Arc Linux system.

Step 4: Verify the Java is installed or not, you can run the following command as follows:

java --version

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!