I’m trying to add java_home in linux machine (centos 5.8)
I’m adding this part to setting JAVA_HOME and PATH for all users in my machine
vi /etc/profile
export JAVA_HOME=/opt/jdkx.x.x_xx
export PATH=$PATH:$JAVA_HOME/bin
after seting it up, i try to verify it by using echo command
echo $JAVA_HOME
but it does not give me any path.Is there something wrong with my configuration?
Question has been edited, answer doesn’t make sense anymore.
Left as a placeholder for comments.
echo $SHELLwill tell you which shell you are using. Most likely /bin/bash.Assuming bash, /etc/profile is only read for a login shell (bash –login), not just a new interactive shell.
i.e. if you