Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openjdk-6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'openjdk-6-jre' has no installation candidate

I think your problem will be resolved by opening software center. Click on 'edit' and then 'software sources' to open the software sources window. Once that is open, check the box that says, "Community-maintained free and open-source software (universe)." like

And then install Open-jdk as suggested by others-

If problem still persists try Oracle Java, as am using Oracle Java and everyone knows what’s the difference between both ,So its better to go with latest Oracle Java

Completely remove Open-jdk

just use this simple commands in terminal to remove open jdk completely

sudo apt-get purge openjdk-\*

How to install Oracle-Java

To get an automatically update-able Java from Oracle, you can you use the PPA provided from webup8.

Installing Oracle Java manually

For installing Latest Oracle Java:

To check ubuntu system architecture installed

$ uname -m

or

$ arch

Download the Oracle Java JDK for Linux. Make sure you select the correct compressed binaries for your system architecture 32-bit or 64-bit (which end in tar.gz).It will be downloaded in Downloads folder in home.So first open nautilus with sudo as