How To Install JAVA ( OpenJDK ) 6 / 7 / 8 on Linux

JAVA is necessary to run certain applications in Linux and windows machine. JAVA comes with two packages (JDK & JRE). JDK stands for (Java Development Kit) which helps developers for developing, debugging, and monitoring Java applications.

JRE stands for (Java Runtime Environment) which deploys Java applications on servers.It includes tools for JVM monitoring and tools commonly required for server applications. Many of us needed only JRE, so make sure you have installed JRE not for JDE.

In this article i’m going to explain how to install OpenJDK in Linux distro such as RHEL, CentOS, Fedora, Ubuntu, Debian, Mint, openSUSE & Arch Linux based systems.

1) Search OpenJDK Packages

Use the below commands to search available java version on your distribution to install further.

[Search OpenJDK Packages on openSUSE]

$ zypper search java | grep openjdk
java-1_7_0-openjdk
java-1_8_0-openjdk

[Search OpenJDK Packages on ArchLinux/Manjaro]

$ pacman -Ss java | grep openjdk
extra/jdk8-openjdk 8.u102-1
extra/jre8-openjdk 8.u102-1 [installed]
extra/jre8-openjdk-headless 8.u102-1 [installed]

[Search OpenJDK Packages in Ubuntu/Mint/Debian]

$ apt-cache search java | grep openjdk
openjdk-6-jdk
openjdk-7-jdk
openjdk-8-jdk

[Search OpenJDK Packages in RHEL/CentOS/Fedora 21 & older]

$ yum search java | grep openjdk
java-1.6.0-openjdk.x86_64
java-1.7.0-openjdk-headless.x86_64
java-1.8.0-openjdk-headless.x86_64

[Search OpenJDK Packages in Fedora 22 & later]

$ dnf search java | grep openjdk
java-1.6.0-openjdk.x86_64
java-1.7.0-openjdk-headless.x86_64
java-1.8.0-openjdk-headless.x86_64

2) Install JAVA (OpenJDK)

We have found the list of available JAVA version on Linux distribution in above step. Use the following commands to install required java (OpenJDK/JRE) version on your system through the package manager.

Install JAVA (OpenJDK/JRE) on openSUSE

[Install JRE - Java Runtime Environment]
$ sudo zypper install java-1_8_0-openjdk

[Install JDE - Java Development Kit]
$ sudo zypper install java-1_8_0-openjdk-devel

Install JAVA (OpenJDK/JRE) on Ubuntu/Mint/Debian]

[Install JRE - Java Runtime Environment]
$ sudo apt-get install openjdk-6-jre

[Install JDE - Java Development Kit]
$ sudo apt-get install openjdk-6-jdk

Install JAVA (OpenJDK/JRE) on RHEL/CentOS/Fedora]

[Install JRE - Java Runtime Environment]
$ sudo yum install java-1.7.0-openjdk.x86_64

$ sudo dnf install java-1.8.0-openjdk.x86_64

[Install JDE - Java Development Kit]
$ sudo yum install java-1.7.0-openjdk-devel.x86_64

Install JAVA (OpenJDK/JRE) on Arch based system]

[Install JRE - Java Runtime Environment]
$ sudo pacman -Syu jre8-openjdk

[Install JDE - Java Development Kit]
$ sudo pacman -Syu jdk8-openjdk

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

Shares
Close
Please support the site
By clicking any of these buttons you help our site to get better