HOWTO Install Sun’s JAVA on Ubuntu Lucid Lynx (10.04)

After Ubuntu’s decision to default to OpenJDK for 10.04 (which is a good decision, IMHO), Sun’s (but is it still Sun, or Oracle?) JAVA somewhat “disappeared” from Ubuntu (multiverse).

That being said, some people may still need features only available in Sun’s JRE/JDK, which might not yet have been Freed.

Actually, Ubuntu is still shipping it, but in its “partner” section. To add that section to your Sources and install Sun’s JDK (as an example), just:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

You might need to accept the license (press “tab”, “enter”, “tab” on “Yes” then “enter”).

You might also just want to install sun-java6-jre or sun-java6-plugin if you just want the (Mozilla) web browser plugin.

As a side note, remember to remove OpenJDK if you do not need it, or be prepared to encounter hard to diagnose problems sometime.

sudo apt-get remove openjdk-6-jdk openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib

Ubuntu 11.10: same operation. Just replace “lucid” por “oneiric”

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

12 Comments

  1. If you don’t have add-apt-repository installed, you may need to grab the package which provides it, like this:
    sudo apt-get install python-software-properties

  2. Now this worked! I am addicted to Yahoo’s Literati (pseudo-Scrabble) game and Ubuntu’s openjdk java and its icedtea plugin do not work at all with it. But it works great with sun-java6-plugin after following the instructions above. I would urge developers to take a look at this game to see what is missing in their open source version. It had trouble re-sizing, and playing boards were blank and would repeatedly start up after I had X’d out of them.

    • second that… instructions don’t get better than that. I’ve been using linux for a couple of years now and I just hate the whole compile your code concept… and instructions like these make all the diff.

      TY

  3. The only “little” drawback is that sun-java6-sdk and sun-java6-jre packages (as well as any other java packages from Oracle) are not available for 11.10/’oneiric’ in specified repository.

  4. sudo apt-get install sun-java6-jdk

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package sun-java6-jdk 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

    Any help, the package is missing.

Leave a Reply

Your email address will not be published. Required fields are marked *