HowTo Update Java Version Linux Step by Step Guide
Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to data centers, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!. In this article we are going to see HowTo Update Java Version Linux Step by Step Guide.
Update Java Version Linux Procedure
# java -version java version "1.7.0_141" OpenJDK Runtime Environment (rhel-2.6.10.1.el7_3-x86_64 u141-b02) OpenJDK 64-Bit Server VM (build 24.141-b02, mixed mode)
Existing Java Version is 1.7.0_141 and we are going to update to 1.8.0_144, Is that simple
Download extra package file from Java site using wget command, below package is 64 bit
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz"
32 bit Java Download method is below
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-i586.tar.gz"
To Download Java directly from command line use below method visit java download link provided above, right click on required package click on Copy Link Address
Login to Terminal and add below strings before download link (Update Java Version Linux)
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "PASTE URL"
Extract Java Downloaded Package for Update Java Version. Use tar command
# cd /opt/java # tar -xvf jdk-8u144-linux-x64.tar.gz
Update Java Version
run Update Java Version command to Update existing Java Package version
]# update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_144/bin/java ]# update-alternatives --config java There are 3 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.141-2.6.10.1.el7_3.x86_64/jre/bin/java) 2 /usr/java/jdk1.8.0_144/jre/bin/java 3 /opt/java/jdk1.8.0_144/bin/java Enter to keep the current selection[+], or type selection number: 3
Let’s add variable path to Java
# export JAVA_HOME=/opt/java/jdk1.8.0_144/ # export JRE_HOME=/opt/java/jdk1.8.0_144/jre # export PATH=$PATH:/opt/java/jdk1.8.0_144/bin:/opt/java/jdk1.8.0_144/jre/bin
Now Verify Java Version
# java -version java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
Update Java Version Linux is completed successfully. Java Version is now 1.8
Related Articles
Thanks for your wonderful Support and Encouragement