Upon logging into my CentOS 7 VM, my $JAVA_HOME is always set to : /usr/lib/jvm/java-1.8.0-openjdk-22.214.171.124-11.b12.el7.x86_64/jre, which is incorrect.
My ~/.bash_profile reads:
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-126.96.36.199-0.b01.el7_4.x86_64/jre export JAVA_HOME
PYCHARM_HOME=/opt/pycharm-community-2017.2.3/ export PYCHARM_HOME
ECLIPSE_HOME=/opt/eclipse export ECLIPSE_HOME
export PATH Sourcing .bash_profile each time I open a new terminal appears to correct the issue, but why is my $JAVA_HOME path defaulting to an old version on startup and not being set to the directory specified in .bash_profile?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!