Java is an object-oriented programming platform used on a wide range of devices and technologies, like laptops, cell phones, game consoles and the Internet.And java plugins allow your web browser to run Java applets. This tutorial shows how to install java and enable java plugins in Firefox/IE.

1.First,Launch Software Sources from System->Administration->Software Sources,check all checkboxes below Download from the Internet in first tab.
2.Open up a terminal window and install sun-java:

sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

and you can use this command to get java version information:

java -version

3.In firefox window,go to Tools->Add-ons,select Plugins tab.If you have java installed in firefox,you’ll see something like Java(TM) Plug-in 1.6.0_10-b33in the list.
4.In firefox,click Edit->Preferences(or Tools->Options).Check the boxes says “Enable Javascript” and “Enable Java.” And click on Advancedfor more configuration.
java
5.In IE,click on Tools->Internet Options.Select the “Security” tab,click on “Custom Settings.”.Scroll down until you see “Scripting for Java applets.” Select “Enable.”