Install Java JDK 11 from RPM/TAR on CentOS 7 - CentLinux

Latest

Monday, 24 December 2018

Install Java JDK 11 from RPM/TAR on CentOS 7

Install-Java-Development-Kit-JDK-11-on-CentOS-7

Java JDK or Java Development Kit is an implementation of Java Platform. JDK includes a private Java Virtual Machine (JVM) and few other resources to facilitate the development of Java applications. JDK is an essential tool required by all Java based applications. Currently, it is the most widely used Software Development Kit (SDK).

In this article, we will install Java JDK 11 on CentOS 7 server from RPM and from tarball.

 

This Article Provides:

     

    Installing Java JDK 11 from RPM on CentOS 7:

    Connect to java-server.example.com using ssh as root user.

    Download Java JDK 11 RPM for CentOS 7 from Oracle Technical Network (OTN) and copy it to the home directory of root user.

    Install the downloaded package using rpm command.

    [root@java-server ~]# rpm -ivh jdk-11.0.1_linux-x64_bin.rpm warning: jdk-11.0.1_linux-x64_bin.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:jdk-11.0.1-2000:11.0.1-ga ################################# [100%]

    Set JAVA_HOME environment variable.

    [root@java-server ~]# echo "export JAVA_HOME=/usr/java/jdk-11.0.1" >> /etc/profile [root@java-server ~]# export JAVA_HOME=/usr/java/jdk-11.0.1

    Verify installation of Java JDK 11 by executing java command.

    [root@java-server ~]# java -version java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

    Java JDK 11 has been installed from RPM Package on CentOS 7 server.

     

    Installing Java JDK 11 from TAR on CentOS 7:

    Connect to java-server.example.com using ssh as root user.

    Download Java JDK 11 TAR for CentOS 7 from Oracle Technical Network (OTN) and copy it to the home directory of root user.

    Extract downloaded tarball using tar command.

    [root@java-server ~]# mkdir /usr/java [root@java-server ~]# tar xvf jdk-11.0.1_linux-x64_bin.tar.gz -C /usr/java/ ... jdk-11.0.1/lib/server/libjsig.so jdk-11.0.1/lib/server/libjvm.so jdk-11.0.1/lib/src.zip jdk-11.0.1/lib/tzdb.dat jdk-11.0.1/release [root@java-server ~]# ls /usr/java/ jdk-11.0.1

    Set JAVA_HOME environment variable.

    [root@java-server ~]# echo "export JAVA_HOME=/usr/java/jdk-11.0.1" >> /etc/profile [root@java-server ~]# export JAVA_HOME=/usr/java/jdk-11.0.1

    Create the symbolic link for java using alternatives command.

    [root@java-server ~]# alternatives --install /usr/bin/java java /usr/java/jdk-11.0.1/bin/java 2 [root@java-server ~]# alternatives --config java There is 1 program that provides 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jdk-11.0.1/bin/java Enter to keep the current selection[+], or type selection number:

    We have only one JDK/JRE installed on this server, therefore, press <ENTER> to keep the current selection.

    Create the symbolic link for javac using alternatives command.

    [root@java-server ~]# alternatives --install /usr/bin/javac javac /usr/java/jdk-11.0.1/bin/javac 2 [root@java-server ~]# alternatives --config javac There is 1 program that provides 'javac'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jdk-11.0.1/bin/javac Enter to keep the current selection[+], or type selection number:

    Press <ENTER>.

    Create the symbolic link for jar using alternatives command.

    [root@java-server ~]# alternatives --install /usr/bin/jar jar /usr/java/jdk-11.0.1/bin/jar 2 [root@java-server ~]# alternatives --config jar There is 1 program that provides 'jar'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jdk-11.0.1/bin/jar Enter to keep the current selection[+], or type selection number:

    Press <ENTER>

    Verify installation of Java JDK 11 by executing java command.

    [root@java-server ~]# java -version java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

    Java JDK 11 has been installed from TAR on CentOS 7 server.

    No comments:

    Post a comment