How to Install Java on Arch Linux

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 
Check Java Installation on Arch Linux

Check Java Installation on Arch Linux

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
Search Java Version in Arch Linux

Search Java Version in Arch Linux

To install the latest version of JRE, run the command.

$ sudo pacman -S jre-openjdk
Install Java JRE in Arch Linux

Install Java JRE in Arch Linux

Press 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
Search Java JDK Version in Arch Linux

Search Java JDK Version in Arch Linux

The first option is usually the latest version, so to install the latest JDK, run the command.

$ sudo pacman -S jdk-openjdk
Install JDK in Arch Linux

Install JDK in Arch Linux

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
Verify Java Version in Arch Linux

Verify Java Version in Arch Linux

Check Java Command Location

Check Java Command Location

Conclusion

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.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

James Kiarie

This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

3 Responses

  1. FrankK says:

    Oracle cannot be installed from a repo.

    Need to register and download from the website

  2. xyph says:

    The title says oracle java but the article shows how to install openjdk.

    • James Kiarie says:

      Hey Xyph, OpenJDK and JRE are the building blocks of JAVA. The article takes you through how to install each of those components which will enable you to install, develop and deploy your JAVA applications.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.