install Sun Java 6 JDK in Ubuntu

You install software in Ubuntu 11.10 with the Ubuntu Software Center (USC). If you search for java6 you’ll find Sun Java(TM) Development Kit (JDK) 6.

Problem 1: you can’t install it because it’s not found in your current software sources
Solution 1: enable the Canonical’s partner repository

Problem 2: the package was recently deleted from the repository (see package 361283)
Solution 2: enable the Canonical’s partner repository from Ubuntu Natty

Here are the steps that worked for me:

  1. edit the /etc/apt/sources.list file
  2. copy, uncomment and replace oneiric with natty in the following two lines (I found them at line 52 and 53)
    # deb http://archive.canonical.com/ubuntu oneiric partner
    # deb-src http://archive.canonical.com/ubuntu oneiric partner
    
  3. reload your sources with the commando:
    sudo apt-get update
    

When you reopen the USC and search for java6, you can finally install it. Optionally you can check the sun-java6-source add-on before installing.

You make the Sun Java 6 JDK the default by executing the following commando:

sudo update-java-alternatives -s java-6-sun

I got these errors but everything seems to be working though

update-alternatives: error: no alternatives for -javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: alternative /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so for mozilla-javaplugin.so not registered, not setting.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
About these ads

2 thoughts on “install Sun Java 6 JDK in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s