Besides $PATH what determines which program is called?

From: George3 (
Date: 03/31/05

Date: 31 Mar 2005 12:58:21 -0800

I'm trying have a Redhat system call Sun's java, not GNU's java by
default from the command line. I've put the path to the Sun compiler
first in .bashrc but it still calls GNU java. When I type echo $PATH it
shows that the Sun path is first. I could enter the full path for Sun's
java on the commandline but when other programs try to call java
themselves they're seeing the GNU version -- what else besides PATH
determines which program is called?