Take a look at http://java.sun.com/j2se/1.5.0/download.jsp
(Java 1.5.0) or http://java.sun.com/j2se/1.4.2/download.html
(for Java 1.4.2). In either case, click on "Download SDK" to get the full Java SDK (so you can develop Java programs), or "Download JRE" (just the runtime, lets you run Java programs someone else has written). Make sure you choose the Linux version, this'll download a BIN file. As root, run this from the command line (you might need to change the permissions to make it executable).
Hope this helps!