I have an ubuntu machine..
In my ~/.bashrc I have set java_home as
export JAVA_HOME=/usr/java/jdk1.7.0_04/bin/java
export PATH=$JAVA_HOME/bin:$PATH
but still when i do
$which java
I get
/usr/bin/java
what can be the reason?
Any help would be greatly appreciated
Thanks
Try
echo $JAVA_HOMEandecho $PATHand you will see that they have been set correctly. The problem is you are asking the shell where is the executable java and it’s not looking at the JAVA_HOME variable.If you’ve just edited your .bashrc, you will need to manually run the file, or login to your shell again to pick up the changes.
You have 2 choices: