My Java version is :
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
I don't set JAVA_HOME in my ~/.bash_profile, but I can use both javac and java!
My .bash_profile looks like this:
export EDITOR="vim"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export MAVEN_HOME="$HOME/opt/maven"
export PATH="$PATH:$MAVEN_HOME/bin"
If I want to install other version of the JDK like 11,14,15...., how can I use that? Do I need to setJAVA_HOME?
And if I have multiple versions of JDK installed at the same time, how can I use them at different times as needed? What I see on the Internet is to configure Java_ Home, I don't know what to do at all, because I'm worried that after I install several other versions of JDK, they won't work.
I use MacOS Big Sur.
JAVA_HOMEto know where to find an executable.