As of Ubuntu Lucid, the Sun Java JRE has been replaced with OpenJDK. Unfortunately, OpenJDK still isn’t a complete drop-in replacement for Sun Java. For instance, the Facebook “Upload Photos” applet doesn’t work correctly; the photos don’t have thumbnails and can’t be rotated before upload. The solution is to install the Sun Java JRE.
- Add the Canonical partner repository.
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
- Install Sun Java JRE.
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-fonts sun-java6-plugin - Update system defaults to prefer Sun Java over OpenJDK.
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun/jre/bin/java
sudo update-alternatives --set javaws /usr/lib/jvm/java-6-sun/jre/bin/javaws
sudo update-alternatives --set mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/*/libnpjp2.so - If that fails, manually choose them from a list. Always choose the option containing “java-6-sun”.
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config mozilla-javaplugin.so - Restart Firefox.
Oh, happy coffee-cup-clock progress bar, how I missed you!
-
Thanks for the tip! I had noticed that I was using the openjdk on my netbook, which was “upgraded” to 10.4 with a clean installation.
Also, I noticed that my main computer had both Sun’s JDK and the openjdk. I upgraded this machine without re-installing the OS. Surprisingly, all of the java-related shortcuts were already pointing at the Sun version.
-
Great guide, this is all the information I needed to replace Iced Tea with good ole Sun for those proprietary apps that refuse to run on Iced Tea.
Thanks a lot!
-
OMG, you’re my HERO! I’ve been trying for literally months to get ONE website to work properly. Your fix took less than a minute, and works for both Firefox and Google Chrome. Thank you so much!
-
8 comments
Comments feed for this article
Trackback link: https://www.tolaris.com/2010/06/10/installing-sun-java-on-ubuntu-lucid/trackback/