Embrace Dreams
Archive for the ‘Java’ Category
Installing Oracle (sun) Java 1.7u2 openSUSE 12.1
February 6th, 2012 | admin
Download the RPM version of Java from www.oracle.com (in my case I downloaded 1.7u1).
The one I downloaded was: jdk-7u2-linux-i586.rpm
Install the jdk with yast2, zypper, or by double clicking the rpm within dolphin or nautilus:
sudo zypper in jdk-7u2-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_02/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_02/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 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 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)
You can test your java at oracles website:
Setup Sun JDK on OpenSuse
December 5th, 2011 | admin
Download JDK from http://java.sun.com, extra to /usr/lib/, mine is: /usr/lib/jdk1.7.0_01
Then:
$sudo /usr/sbin/update-alternatives --install /usr/bin/java java /usr/lib/jdk1.7.0_01/bin/java 3 $sudo /usr/sbin/update-alternatives --install /usr/bin/javac javac /usr/lib/jdk1.7.0_01/bin/javac 3
The last parameter is 3, it’s priority, not very important, you can find other by
$sudo /usr/sbin/update-alternatives --list java
It’s not important, do not care about it.
Now you have new JDK installed, let’s configure it:
$sudo /usr/sbin/update-alternatives --config java $sudo /usr/sbin/update-alternatives --config javac
See the details, you can choose your new installed Sun JDK from list.