How to install Sun Java JDK/JRE in Ubuntu Maverick

As Sun (Oracle) repos has been removed completely from Ubuntu Partner repos in Ubuntu Maverick, you can’t install Sun Java JDK or JRE any more.

Running sudo apt-get install sun-java6-jdk will produce the following error

Package sun-java6-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 sun-java6-jdk has no installation candidate

Same error will be produced if you want to install Sun JAVA JRE.

To solve the issue, you have to switch back to Ubuntu Lucid distribution temporarily. After installing JDK/JRE switch back to original Ubuntu Maverick distro again.

1. System->Administrator->Synaptic Package Manager

2. Settings->Repositories

3. Other Softwares

4. Select Canonical Partners, click Edit, change Distribution to lucid, click OK

5. Repeat step 4 for Canonical Partner (Source Code)

6. Hit Reload

Now try to install Sun Java JDK/JRE 🙂

Don’t forget to change back to original distribution Maverick following the same steps once you are done.

Tips credit: Ubuntu 10.10 Maverick Meercat and Sun JRE

If you need any help, have any query please use the comment form below 🙂

  • Thanks!

    It worked

  • Not necessary to change the distribution to lucid any more, but you do still need to enable the “Canonical Partner” repository, as it was disabled out of the box.
    thanks for the help

  • Thank you for sharing the information 🙂

  • You are welcome 🙂