I am using CentOS 6.5 version. I got sudo permissions and installed java, and set up JAVA_HOME
this way .
$ cat /root/.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
PATH=$PATH:$JAVA_HOME/bin
export PATH
And now when i did
$ echo $JAVA_HOME
/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
But once i logout and do
$ echo $JAVA_HOME
/usr/local/jdk
Could you please tell me how do i set java_home for all users ??