make sure you have run
apt-get update before anything else.
The package name you likely want is
openjdk-6-jre (depending on if you are compiling java or just running java.
Debian is no longer distributing sun-* java packages, as oracle has changed the distribution license in a way which makes it illegal for us to do so.
If this is still not working, please show us the output of
apt-cache policy openjdk-6-jre
Another possibility is that you are running a no longer supported release of Debian, like lenny (5.0) or etch (4.0), which are no longer on the regular Debian mirrors, but on http://archive.debian.org. Those would have out-dated, security-vulnerable versions of the sun java packages. However, if this is the case, I'd expect the
apt-get update command to also give 404 errors. And if this is your situation, my recommendation is to first upgrade to a currently supported release of Debian.
You comment confirms that you are running an outdated version of debian which is no longer supported and no longer carried on the main mirrors. Lenny has been moved to the archive mirror on http://archive.debian.org/ On this archive, you will find old, known to be security-vulnerable versions of the JDKs. You could install these after changing to use the archive mirror, but my strong recommendation is to upgrade to the currently supported release by following the instructions in the chapter 4 of the squeeze release notes