Java Beginner Tutorial 3 - How to install or update JAVA on Mac

preview_player
Показать описание
If you are using MacOS Catalina, you need to set JAVA_HOME in .zprofile instead of .bash_profile. Otherwise echo $JAVA_HOME won't show.

Hi, I am Raghav and today we will learn - How to install or update JAVA on Mac
1. How to setup and install java on mac os
2. How to setup Java env variables
3. How to change/switch java version on your system
_____________________________________

Step 1 : check if java is installed
Terminal : java -version
: javac -version

Step 2 : download and install java

Step 3 : How to set java env variable - JAVA_HOME
echo $JAVA_HOME
setting JAVA_HOME
setting JAVA_HOME in .bash_profile

Step 4 : How to switch java version
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

________ ONLINE COURSES TO LEARN ________

------------ UI TESTING ------------

------------ API TESTING ------------

------------ MOBILE TESTING ------------

------------ CI | CD | DEVOPS ------------

------------ VERSION CONTROL SYSTEM ------------

------------ PERFORMANCE TESTING ------------

------------ PROGRAMMING ------------

------------ IDE ------------

------------ MAVEN ------------

------------ OTHERS ------------

Keep Learning,
Raghav

----------- Connect with Raghav ------------

Like, Subscribe & Share
You can support my mission for education by sharing this knowledge and helping as many people as you can
Рекомендации по теме
Комментарии
Автор

This is the most clear video on How to install JAVA in Mac I have ever found in internet :)

MultiMonalisha
Автор

Thank you so much, I was on Java 6 and I was not sure why I couldn’t do certain things but when I found out I didn’t know how to fix it but this video helped a ton and everything works now thanks man.

steakdressing
Автор

Hi Raghav, can you please update your video at 5'31'' and just add a note saying that you actually need to type "source .bash_profile" and THEN "echo $JAVA_HOME" in order to display the path ? Thanks Sai Niranjan for your comment.

nicolasma
Автор

hi, I had a question pls. I try to switch my java version from 1.7 to 1.8 in terminal. when I test it by java -version or Java - version, i's 1.8 and exactly all good. but, if I quit current terminal and reopen it to check the version, it will come back to 1.7.🤔 probably need to save, but not sure how to do this pls.

chrisz
Автор

@Automation Step by Step hello sir, I have MacBook Air m1, how do I install jdk file on this.
please help me on this.

anuraga
Автор

hello Raghav, thank you for all your early responses..And also I like your Micky and Minnie stories..I want to install java on my Mac OS Catalina 10.15 version..which java version is best to use for all Devops projects..thanks in advance

Revathi
Автор

It might be helpful for older version of macOS. I am currently using macOS Catalina and it's not setting up environment vairable permanently. I am fed up now.

sauravhateme
Автор

Excellent Raghav Sir Salute to you for making thing so simple

bharatluthra
Автор

HELLO RAGHAV
can you also show how to set maven_home in mac

abhinandangowda
Автор

Hi! Just a question. At time 4:50, when I typed ls -l into terminal inside JavaVirtualMachines, my output is just total 0. There are no lines containing jdk contents. Also, I have just created my bash_profile on terminal so I don't have anything located inside and don't have access to copy the export line. Im wondering if you can help me with this? Thank you!

angelapace
Автор

Hi Raghav I tried to locate the java in my mac book but it is displaying that not a valid identifier, please suggest what should I do next, and I am new to mac os

aishwaryapatnaik
Автор

I have performed, vi ~/.bash_profile, Then press i for insert mode and then typed export and the press esc and typed :wq! and enter
Then I opened new terminal and entered echo $JAVA_Home, it is again blank .
But when I am performing vi ~/.bash_profile it is now showing me "export . But why vi ~/.bash_profile is blank which means my env variables arent setting up. pls help

HarpreetSandhu-bnqf
Автор

Below are my quereis,
1.Java is not displayed in system preferences or I cannot able to see jaa version is terminal as well
2.Terminal displays vi ~/.bash_profile with command not found. Can you help in this?

tibinsam
Автор

when i type "cat .bash_profile" it says no such file or yep i can't let it work

Witherblow
Автор

hi raqhav .... i am unable to add the path of java.(i.e i m not getting the export step in my terminal)

garlapatinikitha
Автор

Hello! Trying to use your appium tutorial so installing Java for that. I have followed how to do the ./bash part but can't get it to work. I have an updated version so I am trying to set this
export once I go back and run echo $JAVA_HOME I just get a blank

Inracing
Автор

To download java we need to accept cookies on official website..Is that ok to accept..??

Revathi
Автор

Hello Raghav,


I did what you have mentioned in video but when I try echo %JAVA_HOME, it gives blank. I have restarted mac, but getting same blank result.
Please need your quick help on this as I was willing to learn appium through your video.


Thank You.

surajsurya
Автор

Hi, Could you please help me, there is no hidden file for the java in my mac, what to do then?

Sikandar
Автор

Hi Raghav, I have download jdk13.0.2. I created .bash_profile and added export command but when I exit and type echo $JAVA_HOME - Nothing displayed. Where did I go wrong ? Can you help?

sainiranjan