Question
$JAVA_HOME path not sourced correctly in ~/bash_profile at login?
Hi,
Upon logging into my CentOS 7 VM, my $JAVAHOME is always set to : /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x8664/jre, which is incorrect.
My ~/.bash_profile reads:
.bash_profile
Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
User specific environment and startup programs
JAVAHOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el74.x8664/jre
export JAVAHOME
PYCHARMHOME=/opt/pycharm-community-2017.2.3/
export PYCHARMHOME
ECLIPSEHOME=/opt/eclipse
export ECLIPSEHOME
export SPARK_HOME=/opt/spark
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$JAVAHOME/bin:$SPARKHOME/bin:$PYCHARMHOME/bin:$ECLIPSEHOME
export PATH
Sourcing .bashprofile each time I open a new terminal appears to correct the issue, but why is my $JAVAHOME path defaulting to an old version on startup and not being set to the directory specified in .bash_profile?
help me!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×