02 May 2013
mickgregg.com
Not being on LinkedIn anymore, I thought I should post some kind of online CV, so here it is: mickgregg.com
05 February 2013
Install Oracle Java 6 on Debian Wheezy with update-alternatives
Why Would I Want to do That!
I should open this with a statement about why I generally dislike Java as a web technology, in the hope that the sites forcing me to install this software stop using it. I should then make an apology for using the Oracle implementation of Java over some more open project. I'll do neither.Because there's a well founded scare around the use of Java plugins in web browsers, and because some sites I must use consequently force the use of the most recent Oracle Java, I've installed jdk-6u39-linux-i586.bin from Oracle in a virtual machine, itself using Debian Wheezy.
Quick Procedure
- Get the binary installer from Oracle. I'll not link here; it'll probably change anyway
- $ chmod 0750 /place/where/downloaded/file/is/jdk-6u39-linux-i586.bin
- Get root
- # cd /usr/lib/jvm
- # /place/where/downloaded/file/is/jdk-6u39-linux-i586.bin
- # for j in java javac javaws javadoc javah javap; do update-alternatives --install "/usr/bin/$j" "$j" "/usr/lib/jvm/jdk1.6.0_39/bin/$j" 1066; done
- # update-alternatives --config java
- # update-alternatives --config javac
- # update-alternatives --config javaws
- # update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_39/jre/lib/i386/libnpjp2.so" 1066
- # update-alternatives --config mozilla-javaplugin.so
Quick Explanation
- Download and install Oracle's JDK to /usr/lib/jvm/jdk1.6.0_39
- Let your system know about the new Java alternatives it can use, using `update-alternatives --install`
- I've used priority 1066 to set it higher than the OpenJDK packages I already had installed
- Set your system to use the new alternatives, including the Java web browser plugin, using `update-alternatives --configure`
- `update-alternatives --config java` prompts for which alternative you'd like to use. Pick the number for the Oracle version, if it's not already selected
- I've shown java, javac, and javaws above, but I also set javadoc, javah and javap
Test
- $ java -version
- Open your browser and check that it has the new Java plugin loaded
- about:plugins in Iceweasel, for example
- Go to an offending web site and be happy that it now works, as you curse them for using Java in the first place
Subscribe to:
Posts (Atom)