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

From Thomas-Krenn-Wiki
Jump to: navigation, search

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

  1. Debian and Ubuntu remove Oracle Java (heise.de, 19.12.2011)
  2. Java not automatically uninstalled by Ubuntu (heise.de, 18.01.2012)
  3. Moving to OpenJDK as the official Java SE 7 Reference Implementation (blogs.oracle.com, 09.06.2011)
  4. Oracle retracts License for Free Java Distribution under Linux (heise.de, 29.08.2011)
  5. Java is open source (heise.de, 13.11.2006)
  6. Java -> Installation -> Oracle Java (wiki.ubuntuusers.de)
  7. Oracle releases Java SE 7 Update 4 and JavaFX 2.1 (pro-linux.de, 06.05.2012)

Related articles

Configure Locales in Ubuntu
Fixing Graphics Output Driver Problems of LES with newer Linux Kernels
Install Ubuntu from a USB flash drive