As many of you know, SUSE decided to drop Oracle Java starting with openSUSE 12.1. This decision was due to licensing changes, that we all knew were coming once Oracle swallowed up SUN Microsystems (R.I.P. SUN & OpenOffice).
So, if you still require the Oracle JDK, then here’s how you install it (I require it for work reasons (Juniper VPN)).
Install the jdk with yast2, zypper, or by double clicking the rpm within dolphin or nautilus:
sudo zypper in jdk-7u1-linux-i586.rpm -y
Now you have to setup the alternatives so you can use switch between Iced Tea, which is default, and the Oracle Java.
First install the alternative:
sudo /usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.7.0_01/bin/java" 40
Now install the alternative for your browser plugin:
sudo /usr/sbin/update-alternatives --install "/usr/lib/browser-plugins/javaplugin.so" "javaplugin" "/usr/java/jdk1.7.0_01/jre/lib/i386/libnpjp2.so" 40
Note: the first quotes are pointing to the path, the the name of the alternative script, and the 3rd is the location to point to. The numbers at the end is the priority in case it was set to automode.
Now you have to configure the alternatives, first we’ll do java:
sudo /usr/sbin/update-alternatives --config java
Choose the number associated with /usr/java/jdk1.7.0_01/bin/java, in my case it was 1.
Now lets configure javaplugin:
sudo /usr/sbin/update-alternatives --config javaplugin
Choose the number associated with /usr/java/jdk1.7.0_01/jre/lib/i386/libnpjp2.so, in my case it was 1.
First, for the haters. I do linux for a living on servers, so I’m used to sudo, and that’s why I use it on my laptop.
Second, also for the other haters. Yes, I could have added some super high priority and kept it on auto, but I like doing it manually.
For the rest, you can check to see what you currently have set by running:
/usr/sbin/update-alternatives --query (or --display) java (or javaplugin)