$JAVA_HOME path not sourced correctly in ~/bash_profile at login?
Upon logging into my CentOS 7 VM, my $JAVAHOME is always set to : /usr/lib/jvm/java-1.8.0-openjdk-18.104.22.168-11.b12.el7.x8664/jre, which is incorrect.
My ~/.bash_profile reads:
Get the aliases and functions
if [ -f ~/.bashrc ]; then
User specific environment and startup programs
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?
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.×