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"

Comments

[...] having trouble getting the upgrades – the extra software I like to add (like medibuntu, Java, Flash) onto the netbook; mostly, I suspect, because the servers are overloaded. I’ll wait [...]

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

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.

this is the best information available so far for sun jdk installation. Thank you very much. This has been really helpful

In reply to by YW

Permalink

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

Thanks for posting this. There are way too many posts explaining how to do this via the GUI, who wants a GUI?

Great post. Just for others when you get to the license agreement 'tab' to the ok and select enter

[...] instalasi sun-jdk dapat juga dibaca disini. berhubung link instalasi JDK diatas sudah tidak bisa, ada alternatif nya disini. [...]

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.

In reply to by YW

Permalink

Could you be more precise?

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.