My goal is to set the environment variable JAVA_HOME for an user named grid which is just the traditional user name for hadoop.My machine is a virtual machine deployed in VMware Workstation, 64bit CentOS7.What I do:I edit the file that is supposed to change my user-specific environment variable, i.e. ~/.bash_profile. Below is my code:export JAVA_HOME=/home/grid/jdkexport HADOOP_HOME=/home/grid/hadoopPATH=$PATH:$HADOOP_HOME:$JAVA_HOMEexport PATHVery interestingly, when I log in as user grid, and I run echo $HADOOP_HOME, I get /home/grid/hadoop, but I get an nothing as response when I run echo $JAVA_HOME, literally just nothing, an empty string or null, something like that. I run cd $JAVA_HOME, and I end up in home directory.I tried changing the JDK folder, it didn't work. I tried the same code on another machine, it worked. I put the code in /etc/profile and log in as root, same thing happened, good for echo $HADOOP_HOME but no response for echo $JAVA_HOME.
Why is my environment variable is partially set?
bash;environment variables