First download the j2sdk : in my case it is j2sdk-1_4_2_09-linux-i586.bin. Be sure to get the .bin, not the .rpm.
Next install "java-package" with synaptics or apt-get, whatever your preference, with the command
$ sudo apt-get install java-package.
Note that this will also install the package "fakeroot", if you don't already have it installed. Note also that java-package is in "multiverse", so your repository list /etc/ept/sources.list needs to contain, for example:
http://archive.ubuntu.com hoary/multiverse java-package
Create a Debian java package with fakeroot make-jpkg, for example
$fakeroot make-jpkg j2sdk-1_4_2_09-linux-i586.bin
Important: don't use sudo to do this, and expect to get some warning/ error "permission denied" messages. This should create a debian package - sun-j2sdk1.4_1.4.2+09_i386.deb - ready to install with dpkg. For example,
$ sudo dpkg -i sun-j2sdk1.4_1.4.2+09_i386.deb
Once you've installed it, you'll be up and running with java:
your JAVA_HOME is now, for example, /usr/lib/j2sdk1.4-sun/.
On command line enter:
$ java -version :you should see something like:
java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)