The Java Runtime Environment(JRE) enables your computer to run applications and applets that use Java technology. Without it some web pages would not be completely downloaded. In Ubuntu JRE, and the JRE plugin for Firefox have to be installed personally. Unfortunately Debian based systems have to use an alternative method because Sun Microsystems provides only RPM and Binary packages.
Control if your multiverse repositories are enabled. If not enable them and from the command line type or copy and paste this command;
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts – This command permits you to install JRE version 6 with its relative plug-ins for Firefox. Now follow screen instructions.
Verify the JRE version just installed by typing,
java -version on the command-line
Next open Firefox and type about: plugins in the address bar and check out for Java plugins or take a test from the Sun Microsystems Verify Page.
[Update 1] Same method for your Ubuntu 9.04
[Update 2] For your Ubuntu 9.10 ‘Karmic’ follow the procedure above – – just copy and paste to get the job done.
[Update 3] How to Install Java Runtime Environment JRE7 In Ubuntu