This is in continuation of my previous two stack-overflow questions echo $JAVA_HOME returns blank in MacOS catalina despite having set it properly in zshrc and Not able to change the JDK in Mac OS using Jenv and looks like I found the issue.
Issue is that I am using .zsh and it works fine for aliases when I add a new alias but when I simply add JAVA_HOME
as below line
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home
It doesn't work on the new terminal but when I explicitly do source source ~/.zshrc
then it prints the value of echo $JAVA_HOME
and thats the reason of issues mentioned in my previous questions.
I've verified that zsh
is my login shell as mentioned in several forums but still why content of .zshrc
is not loaded in newly opened terminal?