gist JS

Thursday, November 06, 2008

ubuntu slicehost sun java apt-get

So as part of the ToCollege.net migration from GoDaddy to SliceHost I had the 'opportunity' to learn a new linux distro. After some going back and forth about whether I really felt like doing this and with much reassurance from the assorted linux-heads I decided to take the ubuntu plunge. 

Reassured that apt-get was the indeed the new hotness, I proceeded to attempt the very difficult and subtle and arcane process of... installing java. Easy right?

That's what I thought. Turns out that the open-sources freakos in Ubuntu land are so fixated on free software, that installing Java on Ubuntu is not painless. (Yes I know you thought Java was free, but it turns out it's not free enough to qualify as really free, or something like that. I quite frankly don't care.) 
Long story short, you need to update your source list. Anyway, you might think that adding 'universe' to the list of apt-get sources would be good enough to tell apt that you don't care about the useless OpenJDK, go get me the real Sun JDK, but you'd be wrong. You'd be wrong, because universe actually isn't the largest scope.

But what's bigger than the universe? Well, for standard window/mac user's maybe the universe is as big as it gets, but in Linux land the new hotness is... 'multiverse'

Yes I do know what the multiverse is. Yes I did read Timeline. Yes it is neat. But no, this should not be a prereq for installing Java. The next person who tells me linux is ready for desktop users everywhere gets punched in the nose.

vim /etc/apt/sources.list
add 'multiverse' to the end of all of the strings.

sudo apt-get update
sudo apt-get install sun-java6-jdk

Then, if you were unfortunate enough to get tricked into installing the OpenJDK in your fruitless struggle to get this working.

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

To test that everything is no longer rogered:

java -version

You're looking for something akin to the following.

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)


David H. Cook said...

.That's what I thought. Turns out that .the open-sources freakos in Ubuntu land .are so fixated on free software, that .installing Java on Ubuntu is not .painless.

If you think they're freaks on Ubuntu,
they are even worse on SUSE, (which
they explained to me is why they call
community-edition 'openSUSE'. e.g. They're so nervous about 'tainting' their kernel, that they throw the baby out with the bathwater by discouraging
the use of ndiswrapper by making
you install it yourself (rather than
making it available on their LiveCD,
like Mepis-distro does).

Been doing Linux now for about 5 years,
(a distro-junkie), and I finally settled
on Mepis distro as being the best.
[You'd fine it an easy switch from
Ubuntu, as it's also Debian-based.]

Enough distro-chatter...Cheers...


Anonymous said...

Great Article. You completely fixed my problem.

David Sims said...

You made it easy to get Sun Java 6 going on my Slicehost.

Many thanks,

Anonymous said...

you have a nice site.thanks for sharing this site. various kinds of ebooks are available here


lionstone said...

thanks, adding multiverse did the trick for getting red5 setup on slicehost

Thomas said...

Thanks a lot! This is exactly what I was trying to do and I was stuck. :D