Hi, I'm Chris Moyer's Blog.

apt-get install sun-java6-jdk

I was looking to play with scala, and needed to install the java jdk. (FYI, this is the post that got me interested in scala, part of a series by Alex Blewitt) I kept reading that you could smply apt-get java now, after Sun had changed their licensing a while back, but it took me quite a bit of googling to find out how. (although, that may just be deficiency on my part, as the answer is pretty obvious if you know about Ubuntu components.)

It turns out you can, you just need to add multiverse to your list of apt components. Modify /etc/apt/sources.list from:

#deb http://archive.ubuntu.com/ubuntu/ gutsy universe 

#deb-src http://archive.ubuntu.com/ubuntu/ gutsy universe

to:

deb http://archive.ubuntu.com/ubuntu/ gutsy universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ gutsy universe multiverse

and then:

sudo apt-get install sun-java6-jdk

Note: I uncommented the universe lines, and added multiverse. The universe component isn't strictly needed for this, but I find it useful. universe is software maintained by the community, but which the Ubuntu maintainers make no claims to support, including security fixes. multiverse software includes software which does not meet the Ubuntu free licensing requirements.



Back to Blog Home »