~/.bashrc are whats referred to as
non-login files. Meaning they do not get sourced during a login shell unless called by
/etc/profile or another file.
/etc/profile calls it (as is typical) then if you want to test it in your current shell you have to either source it.
/root: #> source .bashrc (source with the command source)
/root: # . .bashrc (source with a period)
Or you have to instantiate a
login shell by using su or sudo.
/root: # su - (the dash starts a login shell which will re-source login files)
/root: # sudo su - (using sudo to perform the switch user command)
and of course you could just re-login.
Typically though Java paths are not set using .bashrc they are set as separate scripts in the
/etc/profile.d directory. At least on the enterprise distributions I use.
system1:/etc/profile.d # ll
-rw-r--r-- 1 root root 1438 Aug 30 2005 alljava.csh
-rw-r--r-- 1 root root 1682 Jul 13 2005 alljava.sh
system1:/etc/profile.d # cat alljava.sh
if [ -x /usr/$__libdir/jvm/java/bin/java ] || [ -x /usr/$__libdir/jvm/java/bin/jre ] ; then
#....cut for brevity...