Thursday, January 10, 2008

How to install Java 1.6 on Debian Etch Stable

Update: Here is a smarter way

Presently, only java 1.5 (aka java 5) is in the stable repository. Therefore, a little bit of work is needed to install java 1.6.

Start by downloading the files you need from the unstable repository, here.

Download all the files you need, I got the following ones:

sun-java6-bin_6-03-2_i386.deb
sun-java6-doc_6-03-2_all.deb
sun-java6-jdk_6-03-2_i386.deb
sun-java6-jre_6-03-2_all.deb

If you want the doc package, you need to download the documentation zip (jdk-6-doc.zip) from java.sun.com manually, and do the following:

chown root jdk-6-doc.zip
chgrp root jdk-6-doc.zip
mv jdk-6-doc.zip /tmp/

Then I tried a simple

dpkg -i sun-java6-*

to install the packages but they have dependencies on libraries not yet in stable, so I tried to install them manually just to see what apt would tell me:

apt-get install unixodbc libstdc++5

This didn't work of course, but apt suggested that I'd try

apt-get -f install

which amazingly worked. After that java installed like a charm. Don't forget to select the right java version after you're done:

update-alternatives --config java

1 comment:

Anonymous said...

Thanks. This post help me.