NOTE: bash_profile spelling is not right in the video. By mistake I wrote bash_prifile, please pay attention to this.
How to Install and Setup Java in MacOS
Step 2. Find Java Home Path
– /usr/libexec/java_home -v18
Step 3. Set Java Home Path in Bash Profile
– vim .bash_profile
– export JAVA_HOME={PATH from Step 2}
– source ~/.bash_profile
Step 4. Check Everything
– echo $JAVA_HOME
– java -version
– javac -version