A simple solution would be to set JAVA_HOME to where you have java installed. To do this goto /etc/profile.d
This directory contains various files that will be executed when you log on IIRC. Files ending with .sh are read if you use bash-like shells, files ending in .csh will be read when using tcsh-like shells.
Sample for tcsh, assuming you hava java installed in /usr/local/java.
setenv JAVA_HOME /usr/local/java
save and set permission to executable (chmod 755 /etc/profile.d/java.csh)
btw you should create a symlink /usr/local/java to the real place java lies around, this simplyfies(sp?) updates of java to linking to the new version. (this however is only how i prefer to do it, so it's not important