I recently ran into some problems trying to use Facebook’s photo uploader tool in Firefox. It turns out that in Lucid, the Ubuntu developers have opted for OpenJDK instead of standard Java – and this is what is causing the problem with the uploader.
The below steps should allow you to get standard Java setup on your Ubuntu box:
Add the repository
First create a new .list file for the repository
sudo gedit /etc/apt/sources.list.d/java.list
Paste in the following
deb http://archive.canonical.com/ lucid partner
Now update all repositories and install Java
sudo apt-get update && sudo apt-get install sun-java6-jre sun-java6-fonts sun-java6-plugin
Now you need to make sure that the version of Java you just installed is selected as the default Java installation on your system:
sudo update-alternatives --config java
Choose the version of Java you just installed.
Finally, we need to install the Java plugin in Firefox:
mkdir -p ~/.mozilla/plugins
Make a symlink to the Java plugin:
ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/libnpjp2.so
Finally, you may want to implement the following fix which resolves the problem of Chinese characters displaying as 口口 boxes in Java applications:
cd /usr/lib/jvm/java-6-sun/jre/lib/fonts
sudo mkdir fallback
cd fallback
sudo ln -s /usr/share/fonts/truetype/arphic/uming.ttc .
sudo ln -s /usr/share/fonts/truetype/arphic/uming.ttc uming.ttf
Now restart Firefox and everything should be working OK! If you do run into any problems, you may want to consider uninstalling OpenJDK completely as well as the Icedtea Java plugin using Synaptic package manager.
Thanks to Felix Yan’s and Buckynasty’s original posts.