Manual Installation of Oracle Java JRE 6 or SE 7 in Ubuntu

From Thomas-Krenn-Wiki
Jump to navigation Jump to search
Please note that this article / this category refers either on older software / hardware components or is no longer maintained for other reasons.
This page is no longer updated and is purely for reference purposes still here in the archive available.

The Java Runtime Environment (JRE) from Oracle was removed by Ubuntu and Debian from their repositories for reasons of security.[1][2] Older version of JRE are affected by a security problem and updating the package in the repository is no longer possible for legal reasons due to the retraction of the Operating System Distributor License for Java.

If possible, moving to the open source version, OpenJDK, is recommend, since it is considered the reference implementation of Java SE 7.[3]

However, since many applications require the JRE from Oracle, we will show you how to manually install JRE 6 or JRE 7 from Oracle under Ubuntu in this article.

History of the Operating System Distributor License for Java

In August of 2011, Oracle retracted the Operating System Distributor License for Java (DLJ), which was required for legal distribution of the Oracle JRE package.[4] Java had already been released in 2006 as open source. The DLJ was considered an interim solution, so that users could use a well-tested java environment for as long as OpenJDK was being developed.[5]

Installing JRE manually

The following steps for the manual installation of JRE 6 from Oracle are based on information from the ubuntuusers.de wiki[6], supplemented by a symbolic link for simplifying later updates, as well as the steps for Java Webstart (javaws), which is required for remote management consoles.

Installing JRE 6 64-bit manually

sudo mkdir -p /opt/java/64 
sudo mv ~/jre-6u<VERSION>-linux-x64.bin /opt/java/64 
cd /opt/java/64 
sudo chmod 755 /opt/java/64/jre-6u<VERSION>-linux-x64.bin 
sudo ./jre-6u<VERSION>-linux-x64.bin 
sudo ln -s jre1.6.0_<VERSION> jre
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre/bin/java" 1 
sudo update-alternatives --set java /opt/java/64/jre/bin/java 
sudo update-alternatives --install "/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so" \
 "/opt/java/64/jre/lib/amd64/libnpjp2.so" 1
sudo update-alternatives --config mozilla-javaplugin.so 
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java/64/jre/bin/javaws" 1
sudo update-alternatives --set javaws /opt/java/64/jre/bin/javaws

Security Note: Later security updates for JRE 6 will also have to be manually installed.

Installing JRE 7 64-bit manually

Java SE 7 was released by Oracle in May 2012.[7] Perform the following steps to install this version:

sudo mkdir -p /opt/java/64 
sudo mv ~/jre-7u<VERSION>-linux-x64.tar.gz /opt/java/64 
cd /opt/java/64 
sudo tar xzvf ./jre-7u<VERSION>-linux-x64.tar.gz 
sudo ln -s jre1.7.0_<VERSION> jre
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre/bin/java" 1 
sudo update-alternatives --set java /opt/java/64/jre/bin/java 
sudo update-alternatives --install "/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so" \
 "/opt/java/64/jre/lib/amd64/libnpjp2.so" 1
sudo update-alternatives --config mozilla-javaplugin.so 
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java/64/jre/bin/javaws" 1
sudo update-alternatives --set javaws /opt/java/64/jre/bin/javaws

Security Note: Later security updates for JRE 7 will also have to be manually installed.

References

Related articles

Install storcli under Ubuntu
Installing Strawberry Perl in Windows
Mdadm checkarray function