Home Wiki > SDB:Installing Java
Sign up | Login

SDB:Installing Java

tagline: From openSUSE


Tested on openSUSE Recommended articles Related articles
Icon-checked.png

Icon-manual.png Icon-help.png

This article is about installing Oracle Java on openSUSE.

Situation

Due to Oracle (Sun) licensing policies, Java JRE cannot be included in the repositories of openSUSE anymore. Here is a quick guide on how to install the newest and secure version. On the Oracle Java website two versions are available for downloading:

  • Java Runtime Environment (JRE): includes Java virtual machine), libraries, Java application launcher, web browser and in general everything should be needed to run programs written with Java language.
  • Java Development Kit (JDK): in addition to the Java Runtime Environment (JRE) above, it includes all the tools needed to develop, test and debug programs written with Java language.

The JRE installation is a shorter version of the JDK installation, therefor the procedure to install the JDK will be shown first, this way differences with JRE installation should be clearer, should someone want to install just the Java Runtime Environment, for some reason. Therefore, installing both packages when they have the same version number, it is not (quite) useful.
With both the procedures given below, for JDK and for JRE installation, the same name, i.e. jdk_Oracle, will be used for the symbolic link pointing to the folder where the Oracle Java Environment is located. This way, one might even follow both procedures in a sequence, since the JDK and the JRE are installed in different directories, but only the latter is going to be used by your system (or whichever the symbolic link is pointing to).

NOTE: Before actually proceeding further, read the "Discussion" to this SDB for updates and contributions which may not yet have been accepted to be part of the main SDB.


Java Runtime Environment Install using Oracle's RPM

The purpose of this installation method is to be a quick and easy setup. You will not have the Icedtea Web plugin, only the official Java. This method is recommended for those that require Oracle's Java for websites that insist on the genuine article in order to be accessed.

Determine what architecture you are running before downloading the package to your system. To be certain of your architecture, open a terminal by running the command (Alt+F2 in KDE): konsole or xterm

Execute the command:

uname -m

If the output is:

i486
i586
i686

You have a 32-bit architecture

If the output is:

x86_64

You have a 64-bit architecture

Download the official RPM from Java.com and install the RPM with whatever method you prefer. In most cases, navigating to the RPM in the file manager and clicking on it will install it. Or you can install via the terminal, e.g. run the command (Alt+F2 in KDE): konsole or xterm to open a terminal then type:

su

Enter your root password, this will put you in "Superuser" mode. Navigate, as a normal user, to the location of the download, Firefox or Chrome will typically put it in ~/Downloads

cd ~/Downloads

To install using terminal type:

# rpm -ivh jre-7u67-linux-i586.rpm

or, if you downloaded the 64-bit RPM:

# rpm -ivh jre-7u67-linux-x64.rpm

Once the install is complete, copy and paste the following into terminal as root:

# zypper rm icedtea-web

Agree to remove the package. Once it is complete, copy and paste the following:

# update-alternatives --install "/usr/bin/java" "java" "/usr/java/latest/bin/java" 1
# update-alternatives --set java /usr/java/latest/bin/java

What we are interested in, is the file libnpjp2.so (that file location can change any time depending on the SUSE version and the jre package version.) which came with the jre package. You can check that file using rpm command.

rpm -ql jre | grep libnpjp2.so

It should return a result with its absolute path.

If you have previously installed Java in openSUSE, you will need to remove the symbolic link before proceeding.

For 32-bit architecture:

rm /usr/lib/browser-plugins/libnpjp2.so

For 64-bit architecture:

rm /usr/lib64/browser-plugins/libnpjp2.so

You can now create a link and point it to your browser plugin. Paste the following command as root.

For 32-bit architecture:

# plugin=$(rpm -ql jre | grep libnpjp2.so)
# ln -sv "$plugin" /usr/lib/browser-plugins/

For 64-bit architecture:

# plugin=$(rpm -ql jre | grep libnpjp2.so)
# ln -sv "$plugin" /usr/lib64/browser-plugins/

The installation of Java and appropriate links are complete. You can now use Java in any web browser on your system.

Check for the Java Plugin

If you would like to see if the plugin has installed correctly, restart your browser if you have not done so already and enter the following into the address bar. For Firefox enter:

about:plugins

For Chrome / Chromium enter:

chrome://plugins/

Limit Java Disk Usage

Although no icon appears in the menu, there is a Java Control Panel that allows you to easily adjust many settings. In order to access it, open a terminal or in KDE press Alt+F2 to run a command and enter:

jcontrol
  • Click Settings... under Temporary Internet Files
  • Under Disk Space adjust the amount of disk space for storing temporary files to your choosing. 50 to 100 MB should be sufficient.
  • Click OK to close the dialog box and OK to close the Java Control Panel

Java Development Kit installation using Oracle's RPM

Obtaining and installing the rpm package

Like with the JRE, obtain the rpm for your architecture from Oracle's Java website. Install it likewise via

# sudo rpm -ivh jdk-8u5-linux-x64.rpm

(adjust the name of the file if necessary of course :)).

Bash script to gzip manual pages and install update-alternative

Now to include this in update-alternatives (e.g., to have it in your $PATH, use it with Android Studio or similar), you can use the following script (save as some-file-name.sh and run
# sh some-file-name.sh
or make it executable and run it then, whatever you prefer):
#!/bin/bash

sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/appletviewer.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/apt.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/extcheck.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jar.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jarsigner.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/javac.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/javadoc.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/javah.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/javap.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jcmd.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jconsole.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jdb.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jhat.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jinfo.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jmap.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jps.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jrunscript.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jsadebugd.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jstack.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jstat.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/jstatd.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/native2ascii.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/pack200.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/rmic.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/schemagen.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/serialver.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/unpack200.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/wsgen.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/wsimport.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_05/man/man1/xjc.1)
sudo /usr/sbin/update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_05/bin/javac 3 --slave /usr/bin/appletviewer appletviewer /usr/java/jdk1.8.0_05/bin/appletviewer --slave /usr/share/man/man1/appletviewer.1.gz appletviewer.1.gz /usr/java/jdk1.8.0_05/man/man1/appletviewer.1.gz --slave /usr/bin/extcheck extcheck /usr/java/jdk1.8.0_05/bin/extcheck --slave /usr/share/man/man1/extcheck.1.gz extcheck.1.gz /usr/java/jdk1.8.0_05/man/man1/extcheck.1.gz --slave /usr/bin/jar jar /usr/java/jdk1.8.0_05/bin/jar --slave /usr/share/man/man1/jar.1.gz jar.1.gz /usr/java/jdk1.8.0_05/man/man1/jar.1.gz --slave /usr/bin/jarsigner jarsigner /usr/java/jdk1.8.0_05/bin/jarsigner --slave /usr/share/man/man1/jarsigner.1.gz jarsigner.1.gz /usr/java/jdk1.8.0_05/man/man1/jarsigner.1.gz --slave /usr/lib64/jvm/java java_sdk /usr/java/jdk1.8.0_05 --slave /usr/share/man/man1/javac.1.gz javac.1.gz /usr/java/jdk1.8.0_05/man/man1/javac.1.gz --slave /usr/bin/javadoc javadoc /usr/java/jdk1.8.0_05/bin/javadoc --slave /usr/share/man/man1/javadoc.1.gz javadoc.1.gz /usr/java/jdk1.8.0_05/man/man1/javadoc.1.gz --slave /usr/bin/javah javah /usr/java/jdk1.8.0_05/bin/javah --slave /usr/share/man/man1/javah.1.gz javah.1.gz /usr/java/jdk1.8.0_05/man/man1/javah.1.gz --slave /usr/bin/javap javap /usr/java/jdk1.8.0_05/bin/javap --slave /usr/share/man/man1/javap.1.gz javap.1.gz /usr/java/jdk1.8.0_05/man/man1/javap.1.gz --slave /usr/share/man/man1/jcmd.1.gz jcmd.1.gz /usr/java/jdk1.8.0_05/man/man1/jcmd.1.gz --slave /usr/bin/jconsole jconsole /usr/java/jdk1.8.0_05/bin/jconsole --slave /usr/share/man/man1/jconsole.1.gz jconsole.1.gz /usr/java/jdk1.8.0_05/man/man1/jconsole.1.gz --slave /usr/bin/jdb jdb /usr/java/jdk1.8.0_05/bin/jdb --slave /usr/share/man/man1/jdb.1.gz jdb.1.gz /usr/java/jdk1.8.0_05/man/man1/jdb.1.gz --slave /usr/bin/jhat jhat /usr/java/jdk1.8.0_05/bin/jhat --slave /usr/share/man/man1/jhat.1.gz jhat.1.gz /usr/java/jdk1.8.0_05/man/man1/jhat.1.gz --slave /usr/bin/jinfo jinfo /usr/java/jdk1.8.0_05/bin/jinfo --slave /usr/share/man/man1/jinfo.1.gz jinfo.1.gz /usr/java/jdk1.8.0_05/man/man1/jinfo.1.gz --slave /usr/bin/jmap jmap /usr/java/jdk1.8.0_05/bin/jmap --slave /usr/share/man/man1/jmap.1.gz jmap.1.gz /usr/java/jdk1.8.0_05/man/man1/jmap.1.gz --slave /usr/bin/jps jps /usr/java/jdk1.8.0_05/bin/jps --slave /usr/share/man/man1/jps.1.gz jps.1.gz /usr/java/jdk1.8.0_05/man/man1/jps.1.gz --slave /usr/bin/jrunscript jrunscript /usr/java/jdk1.8.0_05/bin/jrunscript --slave /usr/share/man/man1/jrunscript.1.gz jrunscript.1.gz /usr/java/jdk1.8.0_05/man/man1/jrunscript.1.gz --slave /usr/bin/jsadebugd jsadebugd /usr/java/jdk1.8.0_05/bin/jsadebugd --slave /usr/share/man/man1/jsadebugd.1.gz jsadebugd.1.gz /usr/java/jdk1.8.0_05/man/man1/jsadebugd.1.gz --slave /usr/bin/jstack jstack /usr/java/jdk1.8.0_05/bin/jstack --slave /usr/share/man/man1/jstack.1.gz jstack.1.gz /usr/java/jdk1.8.0_05/man/man1/jstack.1.gz --slave /usr/bin/jstat jstat /usr/java/jdk1.8.0_05/bin/jstat --slave /usr/share/man/man1/jstat.1.gz jstat.1.gz /usr/java/jdk1.8.0_05/man/man1/jstat.1.gz --slave /usr/bin/jstatd jstatd /usr/java/jdk1.8.0_05/bin/jstatd --slave /usr/share/man/man1/jstatd.1.gz jstatd.1.gz /usr/java/jdk1.8.0_05/man/man1/jstatd.1.gz --slave /usr/bin/native2ascii native2ascii /usr/java/jdk1.8.0_05/bin/native2ascii --slave /usr/share/man/man1/native2ascii.1.gz native2ascii.1.gz /usr/java/jdk1.8.0_05/man/man1/native2ascii.1.gz --slave /usr/bin/pack200 pack200 /usr/java/jdk1.8.0_05/bin/pack200 --slave /usr/share/man/man1/pack200.1.gz pack200.1.gz /usr/java/jdk1.8.0_05/man/man1/pack200.1.gz --slave /usr/bin/rmic rmic /usr/java/jdk1.8.0_05/bin/rmic --slave /usr/share/man/man1/rmic.1.gz rmic.1.gz /usr/java/jdk1.8.0_05/man/man1/rmic.1.gz --slave /usr/bin/schemagen schemagen /usr/java/jdk1.8.0_05/bin/schemagen --slave /usr/share/man/man1/schemagen.1.gz schemagen.1.gz /usr/java/jdk1.8.0_05/man/man1/schemagen.1.gz --slave /usr/bin/serialver serialver /usr/java/jdk1.8.0_05/bin/serialver --slave /usr/share/man/man1/serialver.1.gz serialver.1.gz /usr/java/jdk1.8.0_05/man/man1/serialver.1.gz --slave /usr/bin/unpack200 unpack200 /usr/java/jdk1.8.0_05/bin/unpack200 --slave /usr/share/man/man1/unpack200.1.gz unpack200.1.gz /usr/java/jdk1.8.0_05/man/man1/unpack200.1.gz --slave /usr/bin/wsgen wsgen /usr/java/jdk1.8.0_05/bin/wsgen --slave /usr/share/man/man1/wsgen.1.gz wsgen.1.gz /usr/java/jdk1.8.0_05/man/man1/wsgen.1.gz --slave /usr/bin/wsimport wsimport /usr/java/jdk1.8.0_05/bin/wsimport --slave /usr/share/man/man1/wsimport.1.gz wsimport.1.gz /usr/java/jdk1.8.0_05/man/man1/wsimport.1.gz --slave /usr/bin/xjc xjc /usr/java/jdk1.8.0_05/bin/xjc --slave /usr/share/man/man1/xjc.1.gz xjc.1.gz /usr/java/jdk1.8.0_05/man/man1/xjc.1.gz


Procedure with development kit included (JDK)

Full Java Environment included.

Warning From here to the end of this section, for any sub-section (Updating Oracle Java included), if your system has a 64-bit architecture, any occurrence of /usr/lib must be replaced with /usr/lib64. Please follow the appropriate subsections for your system architecture, when you are inserting the commands.

Install Oracle Java SE

  • Download Oracle Java SE Development Kit (JDK) from the Oracle Java website. Save it to an easy to remember directory (eg. /tmp)

Download a suitable version for your system architecture. E.g.: with Oracle Java version 1.7.0_7:

Linux x86 (32-bit architecture)
jdk-7u7-linux-i586.tar.gz
Linux x64 (64-bit architecture)
jdk-7u7-linux-x64.tar.gz

  • Open a terminal and run:
    cd /path/to/downloaded/java
  • Decompress it with (as root, just to be sure):
    sudo tar -xzf ./jdk-7uX-linux-XX.tar.gz
  • Fix permissions for the expanded directory and its content:
    sudo chown -R root:root jdk1.X.X_XX/
Linux x86 (32-bit architecture)
  • Open JDK is installed by default in /usr/lib, so let's move Oracle Java to /usr/lib as well:
    sudo mv ./jdk1.X.X_XX/ /usr/lib/
  • Create a symbolic link to /usr/lib/jdk1.X.X_XX/ (this will be important later for updating):
    sudo ln -s -T /usr/lib/jdk1.X.X_XX/ /usr/lib/jdk_Oracle
Linux x86_64 (64-bit architecture)
  • Open JDK is installed by default in /usr/lib64, so let's move Oracle Java to /usr/lib64 as well:
    sudo mv ./jdk1.X.X_XX/ /usr/lib64/
  • Create a symbolic link to /usr/lib64/jdk1.X.X_XX/ (this will be important later for updating):
    sudo ln -s -T /usr/lib64/jdk1.X.X_XX/ /usr/lib64/jdk_Oracle

Inform the system

Java application launcher

  • Compress the man files involved in your installation:
Linux x86 (32-bit architecture)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/java.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/keytool.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/orbd.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/policytool.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/rmid.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/rmiregistry.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/servertool.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/tnameserv.1)
Linux x86_64 (64-bit architecture)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/java.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/keytool.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/orbd.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/policytool.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/rmid.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/rmiregistry.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/servertool.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/tnameserv.1)
  • Prepare the directory for jvm-exports (specific for version 1.7.0):
Linux x86 (32-bit architecture)
  1. sudo mkdir /usr/lib/jvm-exports/jdk_Oracle
    cd /usr/lib/jvm-exports/jdk_Oracle
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar jaas-1.7.0_Orac.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas-1.7.0.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/jce.jar jce-1.7.0_Orac.jar
    sudo ln -s jce-1.7.0_Orac.jar jce-1.7.0.jar
    sudo ln -s jce-1.7.0_Orac.jar jce.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar jdbc-stdext-1.7.0_Orac.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-1.7.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-3.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar jndi-1.7.0_Orac.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi-1.7.0.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar jndi-cos-1.7.0_Orac.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos-1.7.0.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar jndi-ldap-1.7.0_Orac.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap-1.7.0.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar jndi-rmi-1.7.0_Orac.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi-1.7.0.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/jsse.jar jsse-1.7.0_Orac.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse-1.7.0.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse.jar
    sudo ln -s /usr/lib/jdk_Oracle/jre/lib/rt.jar sasl-1.7.0_Orac.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl-1.7.0.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl.jar
  2. sudo /usr/sbin/update-alternatives --install /usr/bin/java java /usr/lib/jdk_Oracle/bin/java 3 --slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib/jdk_Oracle/man/man1/java.1.gz --slave /usr/lib/jvm/jre jre /usr/lib/jdk_Oracle/jre --slave /usr/lib/jvm-exports/jre jre_exports /usr/lib/jvm-exports/jdk_Oracle --slave /usr/bin/keytool keytool /usr/lib/jdk_Oracle/bin/keytool --slave /usr/share/man/man1/keytool.1.gz keytool.1.gz /usr/lib/jdk_Oracle/man/man1/keytool.1.gz --slave /usr/bin/orbd orbd /usr/lib/jdk_Oracle/bin/orbd --slave /usr/share/man/man1/orbd.1.gz orbd.1.gz /usr/lib/jdk_Oracle/man/man1/orbd.1.gz --slave /usr/bin/policytool policytool /usr/lib/jdk_Oracle/bin/policytool --slave /usr/share/man/man1/policytool.1.gz policytool.1.gz /usr/lib/jdk_Oracle/man/man1/policytool.1.gz --slave /usr/bin/rmid rmid /usr/lib/jdk_Oracle/bin/rmid --slave /usr/share/man/man1/rmid.1.gz rmid.1.gz /usr/lib/jdk_Oracle/man/man1/rmid.1.gz --slave /usr/bin/rmiregistry rmiregistry /usr/lib/jdk_Oracle/bin/rmiregistry --slave /usr/share/man/man1/rmiregistry.1.gz rmiregistry.1.gz /usr/lib/jdk_Oracle/man/man1/rmiregistry.1.gz --slave /usr/bin/servertool servertool /usr/lib/jdk_Oracle/bin/servertool --slave /usr/share/man/man1/servertool.1.gz servertool.1.gz /usr/lib/jdk_Oracle/man/man1/servertool.1.gz --slave /usr/bin/tnameserv tnameserv /usr/lib/jdk_Oracle/bin/tnameserv --slave /usr/share/man/man1/tnameserv.1.gz tnameserv.1.gz /usr/lib/jdk_Oracle/man/man1/tnameserv.1.gz
Linux x86_64 (64-bit architecture)
  1. sudo mkdir /usr/lib64/jvm-exports/jdk_Oracle
    cd /usr/lib64/jvm-exports/jdk_Oracle
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar jaas-1.7.0_Orac.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas-1.7.0.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/jce.jar jce-1.7.0_Orac.jar
    sudo ln -s jce-1.7.0_Orac.jar jce-1.7.0.jar
    sudo ln -s jce-1.7.0_Orac.jar jce.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar jdbc-stdext-1.7.0_Orac.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-1.7.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-3.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar jndi-1.7.0_Orac.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi-1.7.0.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar jndi-cos-1.7.0_Orac.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos-1.7.0.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar jndi-ldap-1.7.0_Orac.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap-1.7.0.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar jndi-rmi-1.7.0_Orac.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi-1.7.0.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/jsse.jar jsse-1.7.0_Orac.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse-1.7.0.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse.jar
    sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/rt.jar sasl-1.7.0_Orac.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl-1.7.0.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl.jar
  2. sudo /usr/sbin/update-alternatives --install /usr/bin/java java /usr/lib64/jdk_Oracle/bin/java 3 --slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib64/jdk_Oracle/man/man1/java.1.gz --slave /usr/lib64/jvm/jre jre /usr/lib64/jdk_Oracle/jre --slave /usr/lib64/jvm-exports/jre jre_exports /usr/lib64/jvm-exports/jdk_Oracle --slave /usr/bin/keytool keytool /usr/lib64/jdk_Oracle/bin/keytool --slave /usr/share/man/man1/keytool.1.gz keytool.1.gz /usr/lib64/jdk_Oracle/man/man1/keytool.1.gz --slave /usr/bin/orbd orbd /usr/lib64/jdk_Oracle/bin/orbd --slave /usr/share/man/man1/orbd.1.gz orbd.1.gz /usr/lib64/jdk_Oracle/man/man1/orbd.1.gz --slave /usr/bin/policytool policytool /usr/lib64/jdk_Oracle/bin/policytool --slave /usr/share/man/man1/policytool.1.gz policytool.1.gz /usr/lib64/jdk_Oracle/man/man1/policytool.1.gz --slave /usr/bin/rmid rmid /usr/lib64/jdk_Oracle/bin/rmid --slave /usr/share/man/man1/rmid.1.gz rmid.1.gz /usr/lib64/jdk_Oracle/man/man1/rmid.1.gz --slave /usr/bin/rmiregistry rmiregistry /usr/lib64/jdk_Oracle/bin/rmiregistry --slave /usr/share/man/man1/rmiregistry.1.gz rmiregistry.1.gz /usr/lib64/jdk_Oracle/man/man1/rmiregistry.1.gz --slave /usr/bin/servertool servertool /usr/lib64/jdk_Oracle/bin/servertool --slave /usr/share/man/man1/servertool.1.gz servertool.1.gz /usr/lib64/jdk_Oracle/man/man1/servertool.1.gz --slave /usr/bin/tnameserv tnameserv /usr/lib64/jdk_Oracle/bin/tnameserv --slave /usr/share/man/man1/tnameserv.1.gz tnameserv.1.gz /usr/lib64/jdk_Oracle/man/man1/tnameserv.1.gz

Java compiler

  • Compress the man files involved in your installation:
Linux x86 (32-bit architecture)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/appletviewer.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/apt.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/extcheck.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jar.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jarsigner.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/javac.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/javadoc.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/javah.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/javap.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jcmd.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jconsole.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jdb.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jhat.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jinfo.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jmap.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jps.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jrunscript.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jsadebugd.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jstack.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jstat.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/jstatd.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/native2ascii.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/pack200.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/rmic.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/schemagen.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/serialver.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/unpack200.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/wsgen.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/wsimport.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/xjc.1)

(Directory for jvm-exports: Same as above for Launcher.)

sudo /usr/sbin/update-alternatives --install /usr/bin/javac javac /usr/lib/jdk_Oracle/bin/javac 3 \
--slave /usr/bin/appletviewer appletviewer /usr/lib/jdk_Oracle/bin/appletviewer \
--slave /usr/share/man/man1/appletviewer.1.gz appletviewer.1.gz /usr/lib/jdk_Oracle/man/man1/appletviewer.1.gz \
--slave /usr/bin/apt apt /usr/lib/jdk_Oracle/bin/apt \
--slave /usr/share/man/man1/apt.1.gz apt.1.gz /usr/lib/jdk_Oracle/man/man1/apt.1.gz \
--slave /usr/bin/extcheck extcheck /usr/lib/jdk_Oracle/bin/extcheck \
--slave /usr/share/man/man1/extcheck.1.gz extcheck.1.gz /usr/lib/jdk_Oracle/man/man1/extcheck.1.gz \
--slave /usr/bin/jar jar /usr/lib/jdk_Oracle/bin/jar \
--slave /usr/share/man/man1/jar.1.gz jar.1.gz /usr/lib/jdk_Oracle/man/man1/jar.1.gz \
--slave /usr/bin/jarsigner jarsigner /usr/lib/jdk_Oracle/bin/jarsigner \
--slave /usr/share/man/man1/jarsigner.1.gz jarsigner.1.gz /usr/lib/jdk_Oracle/man/man1/jarsigner.1.gz \
--slave /usr/lib/jvm/java java_sdk /usr/lib/jdk_Oracle \
--slave /usr/lib/jvm-exports/java java_sdk_exports /usr/lib/jvm-exports/jdk_Oracle \
--slave /usr/share/man/man1/javac.1.gz javac.1.gz /usr/lib/jdk_Oracle/man/man1/javac.1.gz \
--slave /usr/bin/javadoc javadoc /usr/lib/jdk_Oracle/bin/javadoc \
--slave /usr/share/man/man1/javadoc.1.gz javadoc.1.gz /usr/lib/jdk_Oracle/man/man1/javadoc.1.gz \
--slave /usr/bin/javah javah /usr/lib/jdk_Oracle/bin/javah \
--slave /usr/share/man/man1/javah.1.gz javah.1.gz /usr/lib/jdk_Oracle/man/man1/javah.1.gz \
--slave /usr/bin/javap javap /usr/lib/jdk_Oracle/bin/javap \
--slave /usr/share/man/man1/javap.1.gz javap.1.gz /usr/lib/jdk_Oracle/man/man1/javap.1.gz \
--slave /usr/share/man/man1/jcmd.1.gz jcmd.1.gz /usr/lib/jdk_Oracle/man/man1/jcmd.1.gz \
--slave /usr/bin/jconsole jconsole /usr/lib/jdk_Oracle/bin/jconsole \
--slave /usr/share/man/man1/jconsole.1.gz jconsole.1.gz /usr/lib/jdk_Oracle/man/man1/jconsole.1.gz \
--slave /usr/bin/jdb jdb /usr/lib/jdk_Oracle/bin/jdb \
--slave /usr/share/man/man1/jdb.1.gz jdb.1.gz /usr/lib/jdk_Oracle/man/man1/jdb.1.gz \
--slave /usr/bin/jhat jhat /usr/lib/jdk_Oracle/bin/jhat \
--slave /usr/share/man/man1/jhat.1.gz jhat.1.gz /usr/lib/jdk_Oracle/man/man1/jhat.1.gz \
--slave /usr/bin/jinfo jinfo /usr/lib/jdk_Oracle/bin/jinfo \
--slave /usr/share/man/man1/jinfo.1.gz jinfo.1.gz /usr/lib/jdk_Oracle/man/man1/jinfo.1.gz \
--slave /usr/bin/jmap jmap /usr/lib/jdk_Oracle/bin/jmap \
--slave /usr/share/man/man1/jmap.1.gz jmap.1.gz /usr/lib/jdk_Oracle/man/man1/jmap.1.gz \
--slave /usr/bin/jps jps /usr/lib/jdk_Oracle/bin/jps \
--slave /usr/share/man/man1/jps.1.gz jps.1.gz /usr/lib/jdk_Oracle/man/man1/jps.1.gz \
--slave /usr/bin/jrunscript jrunscript /usr/lib/jdk_Oracle/bin/jrunscript \
--slave /usr/share/man/man1/jrunscript.1.gz jrunscript.1.gz /usr/lib/jdk_Oracle/man/man1/jrunscript.1.gz \
--slave /usr/bin/jsadebugd jsadebugd /usr/lib/jdk_Oracle/bin/jsadebugd \
--slave /usr/share/man/man1/jsadebugd.1.gz jsadebugd.1.gz /usr/lib/jdk_Oracle/man/man1/jsadebugd.1.gz \
--slave /usr/bin/jstack jstack /usr/lib/jdk_Oracle/bin/jstack \
--slave /usr/share/man/man1/jstack.1.gz jstack.1.gz /usr/lib/jdk_Oracle/man/man1/jstack.1.gz \
--slave /usr/bin/jstat jstat /usr/lib/jdk_Oracle/bin/jstat \
--slave /usr/share/man/man1/jstat.1.gz jstat.1.gz /usr/lib/jdk_Oracle/man/man1/jstat.1.gz \
--slave /usr/bin/jstatd jstatd /usr/lib/jdk_Oracle/bin/jstatd \
--slave /usr/share/man/man1/jstatd.1.gz jstatd.1.gz /usr/lib/jdk_Oracle/man/man1/jstatd.1.gz \
--slave /usr/bin/native2ascii native2ascii /usr/lib/jdk_Oracle/bin/native2ascii \
--slave /usr/share/man/man1/native2ascii.1.gz native2ascii.1.gz /usr/lib/jdk_Oracle/man/man1/native2ascii.1.gz \
--slave /usr/bin/pack200 pack200 /usr/lib/jdk_Oracle/bin/pack200 \
--slave /usr/share/man/man1/pack200.1.gz pack200.1.gz /usr/lib/jdk_Oracle/man/man1/pack200.1.gz \
--slave /usr/bin/rmic rmic /usr/lib/jdk_Oracle/bin/rmic \
--slave /usr/share/man/man1/rmic.1.gz rmic.1.gz /usr/lib/jdk_Oracle/man/man1/rmic.1.gz \
--slave /usr/bin/schemagen schemagen /usr/lib/jdk_Oracle/bin/schemagen \
--slave /usr/share/man/man1/schemagen.1.gz schemagen.1.gz /usr/lib/jdk_Oracle/man/man1/schemagen.1.gz \
--slave /usr/bin/serialver serialver /usr/lib/jdk_Oracle/bin/serialver \
--slave /usr/share/man/man1/serialver.1.gz serialver.1.gz /usr/lib/jdk_Oracle/man/man1/serialver.1.gz \
--slave /usr/bin/unpack200 unpack200 /usr/lib/jdk_Oracle/bin/unpack200 \
--slave /usr/share/man/man1/unpack200.1.gz unpack200.1.gz /usr/lib/jdk_Oracle/man/man1/unpack200.1.gz \
--slave /usr/bin/wsgen wsgen /usr/lib/jdk_Oracle/bin/wsgen \
--slave /usr/share/man/man1/wsgen.1.gz wsgen.1.gz /usr/lib/jdk_Oracle/man/man1/wsgen.1.gz \
--slave /usr/bin/wsimport wsimport /usr/lib/jdk_Oracle/bin/wsimport \
--slave /usr/share/man/man1/wsimport.1.gz wsimport.1.gz /usr/lib/jdk_Oracle/man/man1/wsimport.1.gz \
--slave /usr/bin/xjc xjc /usr/lib/jdk_Oracle/bin/xjc \
--slave /usr/share/man/man1/xjc.1.gz xjc.1.gz /usr/lib/jdk_Oracle/man/man1/xjc.1.gz
Linux x86_64 (64-bit architecture)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/appletviewer.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/apt.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/extcheck.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jar.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jarsigner.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/javac.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/javadoc.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/javah.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/javap.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jcmd.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jconsole.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jdb.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jhat.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jinfo.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jmap.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jps.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jrunscript.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jsadebugd.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jstack.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jstat.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/jstatd.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/native2ascii.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/pack200.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/rmic.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/schemagen.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/serialver.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/unpack200.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/wsgen.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/wsimport.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/xjc.1)

(Directory for jvm-exports: Same used above for Launcher.)

sudo /usr/sbin/update-alternatives --install /usr/bin/javac javac /usr/lib64/jdk_Oracle/bin/javac 3 \
--slave /usr/bin/appletviewer appletviewer /usr/lib64/jdk_Oracle/bin/appletviewer \
--slave /usr/share/man/man1/appletviewer.1.gz appletviewer.1.gz /usr/lib64/jdk_Oracle/man/man1/appletviewer.1.gz \
--slave /usr/bin/apt apt /usr/lib64/jdk_Oracle/bin/apt \
--slave /usr/share/man/man1/apt.1.gz apt.1.gz /usr/lib64/jdk_Oracle/man/man1/apt.1.gz \
--slave /usr/bin/extcheck extcheck /usr/lib64/jdk_Oracle/bin/extcheck \
--slave /usr/share/man/man1/extcheck.1.gz extcheck.1.gz /usr/lib64/jdk_Oracle/man/man1/extcheck.1.gz \
--slave /usr/bin/jar jar /usr/lib64/jdk_Oracle/bin/jar \
--slave /usr/share/man/man1/jar.1.gz jar.1.gz /usr/lib64/jdk_Oracle/man/man1/jar.1.gz \
--slave /usr/bin/jarsigner jarsigner /usr/lib64/jdk_Oracle/bin/jarsigner \
--slave /usr/share/man/man1/jarsigner.1.gz jarsigner.1.gz /usr/lib64/jdk_Oracle/man/man1/jarsigner.1.gz \
--slave /usr/lib64/jvm/java java_sdk /usr/lib64/jdk_Oracle \
--slave /usr/lib64/jvm-exports/java java_sdk_exports /usr/lib64/jvm-exports/jdk_Oracle \
--slave /usr/share/man/man1/javac.1.gz javac.1.gz /usr/lib64/jdk_Oracle/man/man1/javac.1.gz \
--slave /usr/bin/javadoc javadoc /usr/lib64/jdk_Oracle/bin/javadoc \
--slave /usr/share/man/man1/javadoc.1.gz javadoc.1.gz /usr/lib64/jdk_Oracle/man/man1/javadoc.1.gz \
--slave /usr/bin/javah javah /usr/lib64/jdk_Oracle/bin/javah \
--slave /usr/share/man/man1/javah.1.gz javah.1.gz /usr/lib64/jdk_Oracle/man/man1/javah.1.gz \
--slave /usr/bin/javap javap /usr/lib64/jdk_Oracle/bin/javap \
--slave /usr/share/man/man1/javap.1.gz javap.1.gz /usr/lib64/jdk_Oracle/man/man1/javap.1.gz \
--slave /usr/share/man/man1/jcmd.1.gz jcmd.1.gz /usr/lib64/jdk_Oracle/man/man1/jcmd.1.gz \
--slave /usr/bin/jconsole jconsole /usr/lib64/jdk_Oracle/bin/jconsole \
--slave /usr/share/man/man1/jconsole.1.gz jconsole.1.gz /usr/lib64/jdk_Oracle/man/man1/jconsole.1.gz \
--slave /usr/bin/jdb jdb /usr/lib64/jdk_Oracle/bin/jdb \
--slave /usr/share/man/man1/jdb.1.gz jdb.1.gz /usr/lib64/jdk_Oracle/man/man1/jdb.1.gz \
--slave /usr/bin/jhat jhat /usr/lib64/jdk_Oracle/bin/jhat \
--slave /usr/share/man/man1/jhat.1.gz jhat.1.gz /usr/lib64/jdk_Oracle/man/man1/jhat.1.gz \
--slave /usr/bin/jinfo jinfo /usr/lib64/jdk_Oracle/bin/jinfo \
--slave /usr/share/man/man1/jinfo.1.gz jinfo.1.gz /usr/lib64/jdk_Oracle/man/man1/jinfo.1.gz \
--slave /usr/bin/jmap jmap /usr/lib64/jdk_Oracle/bin/jmap \
--slave /usr/share/man/man1/jmap.1.gz jmap.1.gz /usr/lib64/jdk_Oracle/man/man1/jmap.1.gz \
--slave /usr/bin/jps jps /usr/lib64/jdk_Oracle/bin/jps \
--slave /usr/share/man/man1/jps.1.gz jps.1.gz /usr/lib64/jdk_Oracle/man/man1/jps.1.gz \
--slave /usr/bin/jrunscript jrunscript /usr/lib64/jdk_Oracle/bin/jrunscript \
--slave /usr/share/man/man1/jrunscript.1.gz jrunscript.1.gz /usr/lib64/jdk_Oracle/man/man1/jrunscript.1.gz \
--slave /usr/bin/jsadebugd jsadebugd /usr/lib64/jdk_Oracle/bin/jsadebugd \
--slave /usr/share/man/man1/jsadebugd.1.gz jsadebugd.1.gz /usr/lib64/jdk_Oracle/man/man1/jsadebugd.1.gz \
--slave /usr/bin/jstack jstack /usr/lib64/jdk_Oracle/bin/jstack \
--slave /usr/share/man/man1/jstack.1.gz jstack.1.gz /usr/lib64/jdk_Oracle/man/man1/jstack.1.gz \
--slave /usr/bin/jstat jstat /usr/lib64/jdk_Oracle/bin/jstat \
--slave /usr/share/man/man1/jstat.1.gz jstat.1.gz /usr/lib64/jdk_Oracle/man/man1/jstat.1.gz \
--slave /usr/bin/jstatd jstatd /usr/lib64/jdk_Oracle/bin/jstatd \
--slave /usr/share/man/man1/jstatd.1.gz jstatd.1.gz /usr/lib64/jdk_Oracle/man/man1/jstatd.1.gz \
--slave /usr/bin/native2ascii native2ascii /usr/lib64/jdk_Oracle/bin/native2ascii \
--slave /usr/share/man/man1/native2ascii.1.gz native2ascii.1.gz /usr/lib64/jdk_Oracle/man/man1/native2ascii.1.gz \
--slave /usr/bin/pack200 pack200 /usr/lib64/jdk_Oracle/bin/pack200 \
--slave /usr/share/man/man1/pack200.1.gz pack200.1.gz /usr/lib64/jdk_Oracle/man/man1/pack200.1.gz \
--slave /usr/bin/rmic rmic /usr/lib64/jdk_Oracle/bin/rmic \
--slave /usr/share/man/man1/rmic.1.gz rmic.1.gz /usr/lib64/jdk_Oracle/man/man1/rmic.1.gz \
--slave /usr/bin/schemagen schemagen /usr/lib64/jdk_Oracle/bin/schemagen \
--slave /usr/share/man/man1/schemagen.1.gz schemagen.1.gz /usr/lib64/jdk_Oracle/man/man1/schemagen.1.gz \
--slave /usr/bin/serialver serialver /usr/lib64/jdk_Oracle/bin/serialver \
--slave /usr/share/man/man1/serialver.1.gz serialver.1.gz /usr/lib64/jdk_Oracle/man/man1/serialver.1.gz \
--slave /usr/bin/unpack200 unpack200 /usr/lib64/jdk_Oracle/bin/unpack200 \
--slave /usr/share/man/man1/unpack200.1.gz unpack200.1.gz /usr/lib64/jdk_Oracle/man/man1/unpack200.1.gz \
--slave /usr/bin/wsgen wsgen /usr/lib64/jdk_Oracle/bin/wsgen \
--slave /usr/share/man/man1/wsgen.1.gz wsgen.1.gz /usr/lib64/jdk_Oracle/man/man1/wsgen.1.gz \
--slave /usr/bin/wsimport wsimport /usr/lib64/jdk_Oracle/bin/wsimport \
--slave /usr/share/man/man1/wsimport.1.gz wsimport.1.gz /usr/lib64/jdk_Oracle/man/man1/wsimport.1.gz \
--slave /usr/bin/xjc xjc /usr/lib64/jdk_Oracle/bin/xjc \
--slave /usr/share/man/man1/xjc.1.gz xjc.1.gz /usr/lib64/jdk_Oracle/man/man1/xjc.1.gz

Web browser plug-in

Linux x86 (32-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib/browser-plugins/javaplugin.so javaplugin /usr/lib/jdk_Oracle/jre/lib/i386/libnpjp2.so 3 --slave /usr/bin/javaws javaws /usr/lib/jdk_Oracle/jre/bin/javaws --slave /usr/share/man/man1/javaws.1 javaws.1 /usr/lib/jdk_Oracle/man/man1/javaws.1
Linux x86_64 (64-bit architecture)
For openSUSE 64-bit just use, instead:
sudo /usr/sbin/update-alternatives --install /usr/lib64/browser-plugins/javaplugin.so javaplugin /usr/lib64/jdk_Oracle/jre/lib/amd64/libnpjp2.so 3 --slave /usr/bin/javaws javaws /usr/lib64/jdk_Oracle/jre/bin/javaws --slave /usr/share/man/man1/javaws.1 javaws.1 /usr/lib64/jdk_Oracle/man/man1/javaws.1

Making Oracle Java default

You will have to select the appropriate number after running: (This also can be used to switch between different implementations of java).

Java application launcher

sudo /usr/sbin/update-alternatives --config java

Java compiler

sudo /usr/sbin/update-alternatives --config javac

Web browser plug-in

sudo /usr/sbin/update-alternatives --config javaplugin

Setting options specific for version of installed Java (option)

You can even set Oracle Java as an alternative for JDK (and JRE) environments, just for a particular version of Java, in this case 1.7.0; the changes will be applied with usual update-alternatives.

Java application launcher

Linux x86 (32-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib/jvm/jre-1.7.0 jre_1.7.0 /usr/lib/jdk_Oracle/jre 3 --slave /usr/lib/jvm-exports/jre-1.7.0 jre_1.7.0_exports /usr/lib/jvm-exports/jdk_Oracle
Linux x86_64 (64-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib64/jvm/jre-1.7.0 jre_1.7.0 /usr/lib64/jdk_Oracle/jre 3 --slave /usr/lib64/jvm-exports/jre-1.7.0 jre_1.7.0_exports /usr/lib64/jvm-exports/jdk_Oracle

To select your alternative (all architectures):

sudo /usr/sbin/update-alternatives --config jre_1.7.0

Java compiler

Linux x86 (32-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib/jvm/java-1.7.0 java_sdk_1.7.0 /usr/lib/jdk_Oracle 3 --slave /usr/lib/jvm-exports/java-1.7.0 java_sdk_1.7.0_exports /usr/lib/jvm-exports/jdk_Oracle
Linux x86_64 (64-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib64/jvm/java-1.7.0 java_sdk_1.7.0 /usr/lib64/jdk_Oracle 3 --slave /usr/lib64/jvm-exports/java-1.7.0 java_sdk_1.7.0_exports /usr/lib64/jvm-exports/jdk_Oracle

To select your alternative (all architectures):

sudo /usr/sbin/update-alternatives --config java_sdk_1.7.0

Updating Oracle Java

Updating Oracle Java is really easy thanks to the /usr/lib/jdk_Oracle (/usr/lib64/jdk_Oracle on x86_64) link that was created above.

Linux x86 (32-bit architecture)

1) Repeat the procedure up to moving the jdk1.X.X_XX to /usr/lib

2) Then just change the symbolic link /usr/lib/jdk_Oracle to point to the new Java SE
sudo ln -s -f -T /usr/lib/jdk1.X.Y_YY/ /usr/lib/jdk_Oracle
Linux x86_64 (64-bit architecture)

1) Repeat the procedure up to moving the jdk1.X.X_XX to /usr/lib64

2) Then just change the symbolic link /usr/lib64/jdk_Oracle to point to the new Java SE
sudo ln -s -f -T /usr/lib64/jdk1.X.Y_YY/ /usr/lib64/jdk_Oracle

3) Finally re-compress the man files as described above (all architectures).

Adding Java Control Panel

Once you set Oracle Java as your default jvm, you might want to be able to run /usr/lib/jdk_Oracle/bin/jcontrol (replace lib with lib64 if you are running a 64-bit system), e.g. the application providing your Java Control Panel, directly from the applications menu for your favorite Desktop Environment.

In order to add item "Java - Java Control Panel" to the application menu, you will need to create a couple of symbolic links, which you could delete with sudo rm /path/to/your/symlink, should you want to remove Oracle Java. You can create those symbolic links using following commands, taking care that /usr/lib must be replaced with /usr/lib64 if you own a 64-bit system:

Linux x86 (32-bit architecture)
sudo ln -s /usr/lib/jdk_Oracle/jre/bin/jcontrol /usr/bin/
sudo ln -s /usr/lib/jdk_Oracle/jre/lib/desktop/icons/hicolor/16x16/apps/sun-jcontrol.png /usr/share/icons/hicolor/16x16/apps/
sudo ln -s /usr/lib/jdk_Oracle/jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png /usr/share/icons/hicolor/48x48/apps/
sudo ln -s /usr/lib/jdk_Oracle/jre/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png /usr/share/icons/locolor/16x16/apps/
sudo ln -s /usr/lib/jdk_Oracle/jre/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png /usr/share/icons/locolor/48x48/apps/
sudo ln -s /usr/lib/jdk_Oracle/jre/lib/desktop/applications/sun_java.desktop /usr/share/applications
Linux x86_64 (64-bit architecture)
sudo ln -s /usr/lib64/jdk_Oracle/jre/bin/jcontrol /usr/bin/
sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/desktop/icons/hicolor/16x16/apps/sun-jcontrol.png /usr/share/icons/hicolor/16x16/apps/
sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png /usr/share/icons/hicolor/48x48/apps/
sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png /usr/share/icons/locolor/16x16/apps/
sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png /usr/share/icons/locolor/48x48/apps/
sudo ln -s /usr/lib64/jdk_Oracle/jre/lib/desktop/applications/sun_java.desktop /usr/share/applications

Procedure with runtime environment only (JRE)

For Java Runtime Environment only.

Warning From here to the end of this section, for any sub-section (Updating Oracle Java (JRE) included), if your system has a 64-bit architecture, any occurrence of /usr/lib must be replaced with /usr/lib64. Please follow the appropriate subsections for your system architecture, when you are inserting the commands.

Install Oracle Java SE (JRE)

  • Download Oracle Java SE Runtime Environment (JRE) from the Oracle Java website. Save it to an easy to remember directory (eg. /tmp)

Download a suitable version for your system architecture. E.g.: with Oracle Java version 1.7.0_7:

Linux x86 (32-bit architecture)
jre-7u7-linux-i586.tar.gz
Linux x64 (64-bit architecture)
jre-7u7-linux-x64.tar.gz

  • Open a terminal and run:
    cd /path/to/downloaded/java
  • Decompress it with (as root, just to be sure):
    sudo tar -xzf ./jre-7uX-linux-XX.tar.gz
  • Fix permissions for the expanded directory and its content:
    sudo chown -R root:root jre1.X.X_XX/
Linux x86 (32-bit architecture)
  • Open JDK is installed by default in /usr/lib, so let's move Oracle Java to /usr/lib as well:
    sudo mv ./jre1.X.X_XX/ /usr/lib/
  • Create a symbolic link to /usr/lib/jdk1.X.X_XX/ (this will be important later for updating):
    sudo ln -s -T /usr/lib/jre1.X.X_XX/ /usr/lib/jdk_Oracle
Linux x86_64 (64-bit architecture)
  • Open JDK is installed by default in /usr/lib64, so let's move Oracle Java to /usr/lib64 as well:
    sudo mv ./jre1.X.X_XX/ /usr/lib64/
  • Create a symbolic link to /usr/lib64/jdk1.X.X_XX/ (this will be important later for updating):
    sudo ln -s -T /usr/lib64/jre1.X.X_XX/ /usr/lib64/jdk_Oracle

Inform the system (JRE)

Java application launcher

  • Compress the man files involved in your installation:
Linux x86 (32-bit architecture)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/java.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/keytool.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/orbd.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/policytool.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/rmid.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/rmiregistry.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/servertool.1)
sudo gzip $(readlink -f /usr/lib/jdk_Oracle/man/man1/tnameserv.1)
Linux x86_64 (64-bit architecture)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/java.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/keytool.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/orbd.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/policytool.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/rmid.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/rmiregistry.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/servertool.1)
sudo gzip $(readlink -f /usr/lib64/jdk_Oracle/man/man1/tnameserv.1)
  • Prepare the directory for jvm-exports (specific for version 1.7.0):
Linux x86 (32-bit architecture)
  1. sudo mkdir /usr/lib/jvm-exports/jdk_Oracle
    cd /usr/lib/jvm-exports/jdk_Oracle
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar jaas-1.7.0_Orac.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas-1.7.0.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/jce.jar jce-1.7.0_Orac.jar
    sudo ln -s jce-1.7.0_Orac.jar jce-1.7.0.jar
    sudo ln -s jce-1.7.0_Orac.jar jce.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar jdbc-stdext-1.7.0_Orac.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-1.7.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-3.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar jndi-1.7.0_Orac.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi-1.7.0.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar jndi-cos-1.7.0_Orac.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos-1.7.0.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar jndi-ldap-1.7.0_Orac.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap-1.7.0.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar jndi-rmi-1.7.0_Orac.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi-1.7.0.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/jsse.jar jsse-1.7.0_Orac.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse-1.7.0.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse.jar
    sudo ln -s /usr/lib/jdk_Oracle/lib/rt.jar sasl-1.7.0_Orac.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl-1.7.0.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl.jar
  2. sudo /usr/sbin/update-alternatives --install /usr/bin/java java /usr/lib/jdk_Oracle/bin/java 3 --slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib/jdk_Oracle/man/man1/java.1.gz --slave /usr/lib/jvm/jre jre /usr/lib/jdk_Oracle --slave /usr/lib/jvm-exports/jre jre_exports /usr/lib/jvm-exports/jdk_Oracle --slave /usr/bin/keytool keytool /usr/lib/jdk_Oracle/bin/keytool --slave /usr/share/man/man1/keytool.1.gz keytool.1.gz /usr/lib/jdk_Oracle/man/man1/keytool.1.gz --slave /usr/bin/orbd orbd /usr/lib/jdk_Oracle/bin/orbd --slave /usr/share/man/man1/orbd.1.gz orbd.1.gz /usr/lib/jdk_Oracle/man/man1/orbd.1.gz --slave /usr/bin/policytool policytool /usr/lib/jdk_Oracle/bin/policytool --slave /usr/share/man/man1/policytool.1.gz policytool.1.gz /usr/lib/jdk_Oracle/man/man1/policytool.1.gz --slave /usr/bin/rmid rmid /usr/lib/jdk_Oracle/bin/rmid --slave /usr/share/man/man1/rmid.1.gz rmid.1.gz /usr/lib/jdk_Oracle/man/man1/rmid.1.gz --slave /usr/bin/rmiregistry rmiregistry /usr/lib/jdk_Oracle/bin/rmiregistry --slave /usr/share/man/man1/rmiregistry.1.gz rmiregistry.1.gz /usr/lib/jdk_Oracle/man/man1/rmiregistry.1.gz --slave /usr/bin/servertool servertool /usr/lib/jdk_Oracle/bin/servertool --slave /usr/share/man/man1/servertool.1.gz servertool.1.gz /usr/lib/jdk_Oracle/man/man1/servertool.1.gz --slave /usr/bin/tnameserv tnameserv /usr/lib/jdk_Oracle/bin/tnameserv --slave /usr/share/man/man1/tnameserv.1.gz tnameserv.1.gz /usr/lib/jdk_Oracle/man/man1/tnameserv.1.gz
Linux x86_64 (64-bit architecture)
  1. sudo mkdir /usr/lib64/jvm-exports/jdk_Oracle
    cd /usr/lib64/jvm-exports/jdk_Oracle
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar jaas-1.7.0_Orac.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas-1.7.0.jar
    sudo ln -s jaas-1.7.0_Orac.jar jaas.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/jce.jar jce-1.7.0_Orac.jar
    sudo ln -s jce-1.7.0_Orac.jar jce-1.7.0.jar
    sudo ln -s jce-1.7.0_Orac.jar jce.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar jdbc-stdext-1.7.0_Orac.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-1.7.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext-3.0.jar
    sudo ln -s jdbc-stdext-1.7.0_Orac.jar jdbc-stdext.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar jndi-1.7.0_Orac.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi-1.7.0.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar jndi-cos-1.7.0_Orac.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos-1.7.0.jar
    sudo ln -s jndi-cos-1.7.0_Orac.jar jndi-cos.jar
    sudo ln -s jndi-1.7.0_Orac.jar jndi.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar jndi-ldap-1.7.0_Orac.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap-1.7.0.jar
    sudo ln -s jndi-ldap-1.7.0_Orac.jar jndi-ldap.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar jndi-rmi-1.7.0_Orac.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi-1.7.0.jar
    sudo ln -s jndi-rmi-1.7.0_Orac.jar jndi-rmi.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/jsse.jar jsse-1.7.0_Orac.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse-1.7.0.jar
    sudo ln -s jsse-1.7.0_Orac.jar jsse.jar
    sudo ln -s /usr/lib64/jdk_Oracle/lib/rt.jar sasl-1.7.0_Orac.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl-1.7.0.jar
    sudo ln -s sasl-1.7.0_Orac.jar sasl.jar
  2. sudo /usr/sbin/update-alternatives --install /usr/bin/java java /usr/lib64/jdk_Oracle/bin/java 3 --slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib64/jdk_Oracle/man/man1/java.1.gz --slave /usr/lib64/jvm/jre jre /usr/lib64/jdk_Oracle --slave /usr/lib64/jvm-exports/jre jre_exports /usr/lib64/jvm-exports/jdk_Oracle --slave /usr/bin/keytool keytool /usr/lib64/jdk_Oracle/bin/keytool --slave /usr/share/man/man1/keytool.1.gz keytool.1.gz /usr/lib64/jdk_Oracle/man/man1/keytool.1.gz --slave /usr/bin/orbd orbd /usr/lib64/jdk_Oracle/bin/orbd --slave /usr/share/man/man1/orbd.1.gz orbd.1.gz /usr/lib64/jdk_Oracle/man/man1/orbd.1.gz --slave /usr/bin/policytool policytool /usr/lib64/jdk_Oracle/bin/policytool --slave /usr/share/man/man1/policytool.1.gz policytool.1.gz /usr/lib64/jdk_Oracle/man/man1/policytool.1.gz --slave /usr/bin/rmid rmid /usr/lib64/jdk_Oracle/bin/rmid --slave /usr/share/man/man1/rmid.1.gz rmid.1.gz /usr/lib64/jdk_Oracle/man/man1/rmid.1.gz --slave /usr/bin/rmiregistry rmiregistry /usr/lib64/jdk_Oracle/bin/rmiregistry --slave /usr/share/man/man1/rmiregistry.1.gz rmiregistry.1.gz /usr/lib64/jdk_Oracle/man/man1/rmiregistry.1.gz --slave /usr/bin/servertool servertool /usr/lib64/jdk_Oracle/bin/servertool --slave /usr/share/man/man1/servertool.1.gz servertool.1.gz /usr/lib64/jdk_Oracle/man/man1/servertool.1.gz --slave /usr/bin/tnameserv tnameserv /usr/lib64/jdk_Oracle/bin/tnameserv --slave /usr/share/man/man1/tnameserv.1.gz tnameserv.1.gz /usr/lib64/jdk_Oracle/man/man1/tnameserv.1.gz

Web browser plug-in

Linux x86 (32-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib/browser-plugins/javaplugin.so javaplugin /usr/lib/jdk_Oracle/lib/i386/libnpjp2.so 3 --slave /usr/bin/javaws javaws /usr/lib/jdk_Oracle/bin/javaws --slave /usr/share/man/man1/javaws.1 javaws.1 /usr/lib/jdk_Oracle/man/man1/javaws.1
Linux x86_64 (64-bit architecture)
For openSUSE 64-bit just use, instead:
sudo /usr/sbin/update-alternatives --install /usr/lib64/browser-plugins/javaplugin.so javaplugin /usr/lib64/jdk_Oracle/lib/amd64/libnpjp2.so 3 --slave /usr/bin/javaws javaws /usr/lib64/jdk_Oracle/bin/javaws --slave /usr/share/man/man1/javaws.1 javaws.1 /usr/lib64/jdk_Oracle/man/man1/javaws.1

Making Oracle Java default (JRE)

You will have to select the appropriate number after running: (This also can be used to switch between different implementations of java).

Java application launcher

sudo /usr/sbin/update-alternatives --config java

Web browser plug-in

sudo /usr/sbin/update-alternatives --config javaplugin

Setting options specific for version of installed Java JRE (option)

You can even set Oracle Java as an alternative for the JRE environment, just for a particular version of Java, in this case 1.7.0; the changes will be applied with usual update-alternatives.

Java application launcher

Linux x86 (32-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib/jvm/jre-1.7.0 jre_1.7.0 /usr/lib/jdk_Oracle 3 --slave /usr/lib/jvm-exports/jre-1.7.0 jre_1.7.0_exports /usr/lib/jvm-exports/jdk_Oracle
Linux x86_64 (64-bit architecture)
sudo /usr/sbin/update-alternatives --install /usr/lib64/jvm/jre-1.7.0 jre_1.7.0 /usr/lib64/jdk_Oracle 3 --slave /usr/lib64/jvm-exports/jre-1.7.0 jre_1.7.0_exports /usr/lib64/jvm-exports/jdk_Oracle

To select your alternative (all arch):

sudo /usr/sbin/update-alternatives --config jre_1.7.0

Updating Oracle Java (JRE)

Updating Oracle Java is really easy thanks to the /usr/lib/jdk_Oracle (/usr/lib64/jdk_Oracle on x86_64) link that was created above.

Linux x86 (32-bit architecture)

1) Repeat the procedure up to moving the jre1.X.X_XX to /usr/lib

2) Then just change the symbolic link /usr/lib/jdk_Oracle to point to the new Java SE
sudo ln -s -f -T /usr/lib/jre1.X.Y_YY/ /usr/lib/jdk_Oracle
Linux x86_64 (64-bit architecture)

1) Repeat the procedure up to moving the jre1.X.X_XX to /usr/lib64

2) Then just change the symbolic link /usr/lib64/jdk_Oracle to point to the new Java SE
sudo ln -s -f -T /usr/lib64/jre1.X.Y_YY/ /usr/lib64/jdk_Oracle

3) Finally re-compress the man files as described above (all architectures).

Adding Java Control Panel (JRE)

Once you set Oracle Java as your default jvm, you might want to be able to run /usr/lib/jdk_Oracle/bin/jcontrol (replace lib with lib64 if you are running a 64-bit system), e.g. the application providing your Java Control Panel, directly from the applications menu for your favourite Desktop Environment.

In order to add item "Java - Java Control Panel" to the application menu, you will need to create a couple of symbolic links, which you could delete with sudo rm /path/to/your/symlink, should you want to remove Oracle Java. You can create those symbolic links using following commands, taking care that /usr/lib must be replaced with /usr/lib64 if you own a 64-bit system:

Linux x86 (32-bit architecture)
sudo ln -s /usr/lib/jdk_Oracle/bin/jcontrol /usr/bin/
sudo ln -s /usr/lib/jdk_Oracle/lib/desktop/icons/hicolor/16x16/apps/sun-jcontrol.png /usr/share/icons/hicolor/16x16/apps/
sudo ln -s /usr/lib/jdk_Oracle/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png /usr/share/icons/hicolor/48x48/apps/
sudo ln -s /usr/lib/jdk_Oracle/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png /usr/share/icons/locolor/16x16/apps/
sudo ln -s /usr/lib/jdk_Oracle/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png /usr/share/icons/locolor/48x48/apps/
sudo ln -s /usr/lib/jdk_Oracle/lib/desktop/applications/sun_java.desktop /usr/share/applications/
Linux x86_64 (64-bit architecture)
sudo ln -s /usr/lib64/jdk_Oracle/bin/jcontrol /usr/bin/
sudo ln -s /usr/lib64/jdk_Oracle/lib/desktop/icons/hicolor/16x16/apps/sun-jcontrol.png /usr/share/icons/hicolor/16x16/apps/
sudo ln -s /usr/lib64/jdk_Oracle/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png /usr/share/icons/hicolor/48x48/apps/
sudo ln -s /usr/lib64/jdk_Oracle/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png /usr/share/icons/locolor/16x16/apps/
sudo ln -s /usr/lib64/jdk_Oracle/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png /usr/share/icons/locolor/48x48/apps/
sudo ln -s /usr/lib64/jdk_Oracle/lib/desktop/applications/sun_java.desktop /usr/share/applications/

Related documentation

man update-alternatives
less /var/lib/rpm/alternatives/java
less /var/lib/rpm/alternatives/javac
less /var/lib/rpm/alternatives/javaplugin

External links

Other Java related topics