This document is intended to assist with the upgrade of the many new release versions of Oracle Java JDK/JRE on Ubuntu Linux. Every so often, due to bug fixes and security issues Oracle releases updates to their version of the Java...
Method 1 of 4:
32-bit Oracle Java instructions:
Become root user and copy the new compressed Oracle Java binaries from our download directory to /usr/local/javaType/Copy/Paste: cd /home/"your_user_name"/DownloadsType/Copy/Paste: sudo cp -r jdk-7u40-linux-i586.tar.gz /usr/local/javaType/Copy/Paste: sudo cp -r jre-7u40-linux-i586.tar.gz /usr/local/javaType/Copy/Paste: cd /usr/local/java Next we are going to unpack our new version of Oracle Java binaries, in the directory /usr/local/javaType/Copy/Paste: sudo tar xvzf jdk-7u40-linux-i586.tar.gzType/Copy/Paste: sudo tar xvzf jre-7u40-linux-i586.tar.gzMethod 2 of 4:
64-bit Oracle Java instructions:
Become root user and copy the new compressed Oracle Java binaries from our download directory to /usr/local/javaType/Copy/Paste: cd /home/"your_user_name"/DownloadsType/Copy/Paste: sudo -s cp -r jdk-7u40-linux-x64.tar.gz /usr/local/javaType/Copy/Paste: sudo -s cp -r jre-7u40-linux-x64.tar.gz /usr/local/javaType/Copy/Paste: cd /usr/local/java Next we are going to unpack our new version of Oracle Java binaries, in the directory /usr/local/javaType/Copy/Paste: sudo tar xvzf jdk-7u40-linux-x64.tar.gzType/Copy/Paste: sudo tar xvzf jre-7u40-linux-x64.tar.gz At this point you should have two new uncompressed binary directories in /usr/local/java for the Java JDK/JRE listed as:jdk1.7.0_40
jre1.7.0_40
Along with:
jdk1.7.0_25
jre1.7.0_25
Method 3 of 4:
Modify your Linux system PATH:
Edit the system PATH file /etc/profile and add the following system variables to your system path. Use gedit, nano or any other text editor, as root, and open up /etc/profileType/Copy/Paste: sudo gedit /etc/profile
orType/Copy/Paste: sudo nano /etc/profile Scroll down using your arrow keys to the end of the file and add the following lines below to the end of your /etc/profile file in Ubuntu Linux,at this point you are going to be changing the version numbers from the old Oracle Java to the new version of Java, you will change the versions numbers in the following system PATH file /etc/profile:Modify the /etc/profile file:
JAVA_HOME=/usr/local/java/jdk1.7.0_25
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.7.0_25
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Change to this:
JAVA_HOME=/usr/local/java/jdk1.7.0_40
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.7.0_40
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Save the file and exit
Kareem WintersUpdate 04 March 2020
ncG1vNJzZmismaXArq3KnmWcp51ktbDDjK2mZq2gnL%2BisMRmpquZk6GybrbAr5hmp55iwqPBza2sZqSZo8K5