Good question. Follow this HOWTO:
http://www.helmuth.net/mitel-sme/SunJDK/sunjdk-howto.htmIt's dated but should still work.
Also, here are my scribble notes from a project I was working on. It may be duplicate notes from the howto or I thought Sun's confusing documentation didn't make it any easier.
INSTALL ON SME
-java JDK (not JRE, not J2EE) must be installed
-get java JDK
http://java.sun.com/j2se/1.5.0/download.jsp (get the JDK package)
-look under the J2EE section & find the latest JDK
-get "linux rpm in self-extracting file" (jdk-1_5_0_06-linux-i586-rpm.bin)
-./j2eesdk-*
-link java with a "ln -s /usr/java/jdk/bin/java /usr/bin" before java will work
-test java with a: java -version
-copy jar file to dir
-"java -jar java_installer.jar"