I know this is an old post (but I was looking and didn't quite find what I needed and I love linuxquestions and others might want to know...).
I only installed the base install of Debian 5 and didn't say yes to allowing all the online repositories (and use iceweasel and not firefox), so my steps were as follows:
sudo pico /etc/apt/sources.list
# added "deb
http://mirrors.kernel.org/debian lenny non-free"
sudo apt-get update
sudo apt-get install sun-java6-jre
sudo ln -s /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/iceweasel/plugins/libjavaplugin_oji.so
# symbolic link because
http://plugindoc.mozdev.org/linux.html#Java says don't copy
and then of course, craigevil's suggestion (spelled out):
sudo update-alternatives --config java
# type "3" and Enter (because "/usr/lib/jvm/java-6-sun/jre/bin/java" is option 3 for me)
sudo rm -r /usr/lib/jvm/java-gcj
sudo rm -r /usr/bin/gij-4.3
# i.e. remove the other two options