As Roalt said, install Sun Java.
1 - Go to Oracle Java Download
2 - Select Linux (self-extracting file) filesize: 20.6 MB
3 - Save the file to /home/YourUserName/Downloads
In Terminal, copy and paste the following commands
1 - cd /opt
2 - sudo mkdir java
Press Enter.
Type your password. You won't see anything, not even dots, this is normal.
Press Enter.
3 - cd java
4 - sudo mkdir 32
5 - sudo mv ~/Downloads/jre-6u25-linux-i586.bin /opt/java/32
Press Enter.
6 - sudo chmod 755 /opt/java/32/jre-6u25-linux-i586.bin
7 - cd /opt/java/32
8 - sudo ./jre-6u25-linux-i586.bin
9 - sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/32/jre1.6.0_25/bin/java" 1
Press Enter.
Note: are you updating from a previous Java version, which you have removed manually? Then you'll need to execute the above command twice, because you'll get an error message the first time.
10 - sudo update-alternatives --set java /opt/java/32/jre1.6.0_25/bin/java
11 - mkdir ~/.mozilla/plugins
12 - sudo apt-get remove icedtea6-plugin
13 - rm ~/.mozilla/plugins/libnpjp2.so
14 - ln -s /opt/java/32/jre1.6.0_25/lib/i386/libnpjp2.so ~/.mozilla/plugins/
Final check
Now close and restart Firefox or Chrome. Check if everything has succeeded. Type in the url bar of Firefox (not in the terminal!):
about:plugins
Press Enter.
And scroll down, until you see something approximately similar to this:
Java(TM) Plug-in 1.6.0_25
All the commands are from Easy Linux Tips Project and I can confirm that they do work as I have followed these instructions when installing the latest version of Java