export JAVA_HOME=$DEV_HOME/tools/jdk1.6.0_45 # export JAVA_HOME=$DEV_HOME/tools/jdk1.7.0_51 # export JAVA_HOME=$DEV_HOME/tools/jdk1.8.0 export PATH=$PATH:$JAVA_HOME/bin
I work with multiple versions of Java like above.
So i comment out required version of java from export and then do
This changes the JAVA_HOME , but java -version does not changes.
Means the path does not gets updated.
Any idea how can i force path also to have new java version
One solution i found is to add following lines in .profile to reset PATH to default and then add what i have customized
Not sure if this is ideal solution
After that i have my custom path statements like java home etc