1. At first you should download the java fromhttp://java.com/en/download/index.jsp
extract it, here i locate it in ~/Software/jdk
2. Make sure that there is the folder ~/.mozilla/plugins which once you have install firefox
3. ln the extension.
sudo ln -s ~/Software/jdk/lib/amd64/libnpjp2.so ~/.mozilla/plugins
Restart you browser, done!
Have fun with Ubuntu!