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

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

Automation Step by Step

7 лет назад

59,125 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Chris Z
Chris Z - 16.03.2023 12:33

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.

Ответить
Nicolas Ma
Nicolas Ma - 14.11.2022 23:11

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.

Ответить
Mahek Desai
Mahek Desai - 10.11.2021 13:47

Use "source ~/.bash_profile" to run the script only then Java home will display output

Ответить
Anurag A
Anurag A - 19.10.2021 09:04

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

Ответить
Kshitiz
Kshitiz - 21.07.2021 17:44

Thanks for the detailed video, Ragahv. Just wanted to inform many people with updated macOs might be facing issue where echo $JAVA_HOME command will not show the path set. For those just wanted to mention, for me my terminal default was Z shell or zsh. People can find it looking at the top bar of the terminal. For you it is bash, so the echo command display JAVA_HOME. For people Facing this issue, use " source ~/.bash_profile command " after setup and closing the window. Also see below to change terminal

Edit:
If you want to change your terminal, you can use the following commands on any opened terminal window

For bash:
chsh -s /bin/bash

For Zsh:
chsh - s /bin/zsh

Ответить
bharat luthra
bharat luthra - 12.06.2021 11:31

Excellent Raghav Sir Salute to you for making thing so simple

Ответить
Ian Nater
Ian Nater - 28.05.2021 21:04

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 JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home once I go back and run echo $JAVA_HOME I just get a blank

Ответить
Rizvi Raihan
Rizvi Raihan - 07.05.2021 20:52

Thank you for the tutorial.

It looks like i have 3 Virtual Machines :(

Matching Java Virtual Machines (3):
10.0.2 (x86_64) "Oracle Corporation" - "Java SE 10.0.2" /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
1.8.291.10 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_291 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home


I would like to remove "Java", the middle one. How do i do that?

if i set in export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) in .bash_profile

then java -version is showing

java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

and javac -version is showing

javac 10.0.2

How to make both java and javac version same?
Please help.

Ответить
Harpreet Sandhu
Harpreet Sandhu - 18.03.2021 18:17

I have performed , vi ~/.bash_profile , Then press i for insert mode and then typed export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home 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 JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home" . But why vi ~/.bash_profile is blank which means my env variables arent setting up. pls help

Ответить
Revathi G
Revathi G - 31.01.2021 02:55

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

Ответить
my world
my world - 11.12.2020 20:18

Hii bhai mare I Mac me java install nhi ho raha

Ответить
Steak Dressing
Steak Dressing - 17.10.2020 23:45

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.

Ответить
Revathi G
Revathi G - 29.08.2020 21:55

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

Ответить
Garlapati Nikitha
Garlapati Nikitha - 11.08.2020 22:44

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

Ответить
Aishwarya Patnaik
Aishwarya Patnaik - 18.06.2020 20:00

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

Ответить
Alone Musk
Alone Musk - 10.06.2020 22:12

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.

Ответить
Hari Krishna
Hari Krishna - 10.03.2020 21:23

it confused the beginners at step3

Ответить
Sai Niranjan
Sai Niranjan - 28.02.2020 02:06

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?

Ответить
Suraj
Suraj - 11.02.2020 11:25

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.

Ответить
naga Varigonda
naga Varigonda - 23.01.2020 17:14

i have added export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
to .bash_profie..still am not able to see echo $JAVA_HOME.Please can you help.

Ответить
Sonia Automation
Sonia Automation - 24.10.2019 20:34

Can you please give the command to switch the java version permanently , I tried
.bash_profile export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
but it doesn't work

Ответить
Arun Kumar 0603
Arun Kumar 0603 - 12.10.2019 18:56

Hello Sir, I am not able to save JAVA 1.8 as permanent. After starting new session it is giving JAVA "13" version

Ответить
Abhinandan Gowda
Abhinandan Gowda - 01.08.2019 08:24

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

Ответить
Silence Of The Sound
Silence Of The Sound - 29.07.2019 00:11

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

Ответить
HutteGuiri
HutteGuiri - 29.05.2019 19:09

I dont know anything about this. I tried to Install Jira and i have to start with Java. When i type cat .bach_profile it doesnt show em nothing. I dont know what a bash profile is. Can anyone help me pls?

Ответить
Monalisha Prusty
Monalisha Prusty - 10.05.2019 22:45

Hi Raghav, I am able to change the java version from 12 to 11, but every time I restart my terminal it is going back to 11. Please help

Ответить
Monalisha Prusty
Monalisha Prusty - 10.05.2019 22:02

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

Ответить
Sana Ambreen
Sana Ambreen - 02.08.2018 12:15

this video is only for mac book?right
not for windows?

Ответить
puneet hundal
puneet hundal - 19.03.2018 23:43

i have created the bash_profile using touch command but i can not figure out how to export java file as i can't see it. please help me with it . i don't see export JAVA_HOME=/library/java..... ? i try writing the export command also using edit command for bash file using my latest jdk, but was not successful please let me know where i am wrong.

Ответить
Usman
Usman - 07.10.2017 12:52

thanks a lot for solving my problem.

Ответить
Wither
Wither - 01.08.2017 16:28

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

Ответить
Sai Prasad reddy
Sai Prasad reddy - 17.03.2017 20:58

Thanks, it worked for me.

Ответить