go to
http://java.sun.com/webapps/download/Display
get the Linux self-extracting file Make sure it is the SDK!!
run it from /usr/local
This just creates a java<version> directory. if you cd down into the bin you can type java -version and get a read out, but that is not really what you want so.....
then do this:
ln -s /usr/local/java_<versionyoudownloaded> /usr/local/java (or the other way around can never remember :P)
cd ~
vi .bash_profile or .profile depending on your shell pref.
and these lines
JAVA_HOME=/usr/java export JAVA_HOME
Than in you PATH line add this
PATH=$PATH:$JAVA_HOME/bin export PATH
then to source the profile type
. .bash_profile
then you should bge able to ....
echo $JAVA_HOME
and see path to java dir.
and run java -version from any dir..
hope this helps