Java packages for Ubuntu 11.04 Natty has not yet available in the official repository. However, there’s an easy way to get sun-java-jre, sun-java-jdk, and sun-java-jre-plugin by adding a third-party ppa.

Open up a terminal window under Application -> Accessories -> Terminal, adding the ppa by:

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update

Then, install java jre:

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

Install Jdk by the command:

sudo apt-get install sun-java6-jdk