The Oracle Java 8 and Java 11 required subscription to download and install. So we use OpenJDK for this installation to run Java on CentOS 7/6 and RHEL 7/6 Linux system.. This article will help you to install Java 11 on CentOS 7/6, RHEL 7/6 Linux system.

Advertisement

Step 1 – Search Java Packages

The OpenJDK rpm packages are available under the AppStream repository. Use the following command to search available Java packages under configured yum repositories.

sudo dnf search openjdk

Step 2 – Install Java 11 on CentOS

Now, use one of the following commands to install the required Java version on your CentOS 7/6 and RHEL 7/6 Linux system. You can also install the multiple Java version on any system and use it as per your requirements.

sudo dnf install java-11-openjdk

Step 3 – Check Java Version

Let’s check the installed and current active Java version on your system using the following command:

java -version

openjdk version "11.0.4" 2019-07-16 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.4+11-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.4+11-LTS, mixed mode, sharing)
Share.

9 Comments

  1. if i export environment variable to the /ect/environment in centos 7 vi,ls etc commands are not working and unable to enter into the system after reboot

  2. meenal deshpande on

    Java is a programming language which is used in lots of places in today’s world from android apps to commercial e-commerce website from financial applications to scientific tools, games, electronic trading devices and other desktop applications similar to IntelliJ, Eclipse, Netbeans from an open source library to J2ME apps.
    Thanks for sharing the article.

Exit mobile version