I keep all my env variables in ~/.profile file, so they get exported when I open new shell. Recently I had to modify one of PATH parts, to downgrade from Hadoop 2.6.0 to Hadoop 2.3.0. So, my .profile looks like that (i commented out old HADOOP_INSTALL):
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export GRADLE_HOME=/home/kranach/tools/gradle-2.2.1
#export HADOOP_INSTALL=/home/kranach/hadoop-2.6.0
export HADOOP_INSTALL=/home/kranach/hadoop-2.3.0
export M2_HOME=/home/kranach/tools/apache-maven-3.2.5
export PIG_HOME=/home/kranach/tools/pig-0.14.0
#export HIVE_HOME=/home/kranach/tools/apache-hive-0.14.0-bin/
export HIVE_HOME=/home/kranach/tools/hive12
export HBASE_HOME=/home/kranach/tools/hbase-0.98.10-hadoop2
PATH="$PATH:$GRADLE_HOME/bin:$HADOOP_INSTALL/bin:$HADOOP_INSTALL/sbin:$M2_HOME/bin:$PIG_HOME/bin:$HIVE_HOME/bin:$HBASE_HOME/bin"
After doing this change, I closed and re-opened terminal but without any effect - the PATH still contains hadoop 2.6.0 entry. I tried doing source ~/.profile
, but it only appends new entries to PATH, without replacing old one. What should I do to make changes to PATH visible then, without having to close all my windows and re-logging?
~/.profile
gets read on login only. When you start a new shell it reads ~/.bashrc
.
See https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html for more details.