If you have Knoppix 5.3.1, it is mostly Debian Lenny. Right now on i386 the only sun-java that the official Debian repo installs correctly so it works is the sun-java5-jre sun-java5-plugin combination.

I believe it is already installed on Knoppix 5.3.1 though, so perhaps you are looking to install the development kit? I think that is sun-java5-sdk (something like that). Just do:

aptitude update
aptitude keep-all
aptitude search sun-java5

See what the exact package is named.

aptitude install sun-java5-sdk (if that's the name).

I say do aptitude keep-all because Knoppix may have been built using apt-get and/or synaptic so aptitude needs to be told not to start removing what it thinks were automatically installed packages. From then on you can use it safely as long as you just use it. If you intend to install/remove stuff using apt-get or synaptic then you'd need to do aptitude keep-all again, defeating the purpose of its internal package management. Might as well never use it in that case. It's the best Debian front end to apt, but must be used exclusively to be most effective. Open the NCurses GUI by just running:

aptitude

and check out its help manual.

If you don't love aptitude then just use apt-get or synaptic to accomplish the same purpose. You should be able to get Java installed and working fine. Eventually the Java 6 packages will get fixed.

To make sure sun is set as the system java:

update-java-alternatives java-1.5.0-sun set
update-alternatives --config java
update-alternatives --config java_vm
update-alternatives --config javaws
update-alternatives --config firefox-javaplugin.so
update-alternatives --config iceweasel-javaplugin.so
update-alternatives --config mozilla-javaplugin.so
update-alternatives --config iceape-javaplugin.so
update-alternatives --config xulrunner-javaplugin.so

Not sure whether you'll need to do the update-alternatives --config stuff once you've done update-java-alternatives with the set switch as that usually configures all of them.