Monday, January 9, 2012

Oracle (Sun) Java 6 in Ubuntu 10.04 LTS

First Part:
  1. Download *rpm.bin package from official site. Try to install it and it fails with unpacked rpm package.
  2. Convert with alien: alien --scripts ./jre-6u30-linux-amd64.rpm
  3. dpkg -i jre_1.6.030-1_amd64.deb
  4. update-alternatives --get-selections |grep java
  5. update-alternatives --install "/usr/bin/java" "java" "/usr/java/default/bin/java" 1
  6. update-alternatives --set java /usr/java/default/bin/java
  7. update-alternatives --list java to check
  8. update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/default/bin/java" 1
  9. update-alternatives --set javaws /usr/java/default/bin/javaws
 Second part - browser plugin:
Google chrome found plugin without problems. The steps for Firefox are following:
  1. Check what's in /usr/lib/mozilla/plugins/ and remove open jdk icedtea or whatever. Name "" is important. 
  2. Simply link it this way:

ln -s /usr/java/default/lib/amd64/ /usr/lib/mozilla/plugins/

Or use update-alternatives:

update-alternatives --install "/usr/lib/mozilla/plugins/" "mozilla-javaplugin" "/usr/java/default/lib/amd64/" 1
update-alternatives --set mozilla-javaplugin "/usr/java/default/lib/amd64/"

 Third part. Don't forget about Look&Feel:

(Default Ubuntu location)
# uncomment to set the default look and feel to GTK

(New with authintic Java install):

# uncomment to set the default look and feel to GTK

set JAVA_HOME=/usr/java/default; in /etc/environment or export in .bashrc