How to Install Java JDK on Mac OS and set JAVA HOME variable

Опубликовано: 03 Октябрь 2023
на канале: Automation Step by Step
26k
161

All Free Tutorials

How to Install Java JDK on Mac OS and set JAVA_HOME variable

Step 1 - Check if Java is already installed java -version

Step 2 - Install Homebrew /bin/bash -c "$(curl -fsSL

Step 3 - Install JDK with Homebrew brew install openjdk
brew install openjdk

Step 4 - Verify installation java -version

Step 5 - Set Java Home

Homebrew will usually set the JAVA_HOME environment variable correctly
However, if it's not set or you need to set it manually.
Can do so by adding the following line to your shell profile file
(.bash_profile, .zshrc, or similar):

export JAVA_HOME="/usr/local/opt/openjdk"

To apply this change, run:

source ~/.bash_profile # or ~/.zshrc if you're using Zsh


On Mac OS X 10.5 or later, we can use /usr/libexec/java_home to return the location of the default JDK.


Raghav Pal
AutomationStepByStep.com

▬▬▬▬▬▬▬

Every Like & Subscription gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can

Never Stop Learning
Raghav Pal


▬▬▬▬ USEFUL LINKS ▬▬▬▬

Ask Raghav -

Shorts Eng -
Shorts Hindi -

GitHub Repositories -
Udemy -
Stories -

▬▬ CI | CD | DEVOPS ▬▬
Jenkins Beginner -
Jenkins Tips & Trick -
Docker -
Jenkinsfile -
Kubernetes -
Vagrant -
Ansible -

▬▬ UI TESTING ▬▬
Selenium Beginners -
Selenium Java Framework from Scratch -
Selenium Python -
Selenium 4 -
Selenium Tips -
Selenium Builder -
Katalon Studio -
Robot Framework with RIDE-
Robot Framework with Eclipse -
Protractor -
AccelQ -
Test Project -
Cucumber BDD -
Cypress -
Playwright -
WebdriverIO -
XPath & Web Locators -

▬▬ API TESTING ▬▬
Web Services (API) -
SoapUI -
Postman -
Postman 2022 -
Rest Assured -
Karate API Testing -
General -
JMeter API Testing -
Katalon Studio API Testing -
API Mocking -

▬▬ MOBILE TESTING ▬▬
Appium -
Mobile Playlist -

▬▬ PERFORMANCE TESTING ▬▬
JMeter Beginner -
JMeter Intermediate -
JMeter Advanced -
JMeter Tips & Tricks -
Gatling -
Performance Testing -

▬▬ SOURCE CODE MANAGEMENT ▬▬
Git & GitHub -
GITLAB -

▬▬ IDE ▬▬
Eclipse -
IntelliJ IDEA -
Visual Studio Code -

▬▬ PROGRAMMING ▬▬
Java Beginners -
Java Tips & Tricks -
Groovy -
JavaScript -
TypeScript -
Python -
Ruby -

▬▬ BUILD TOOLS ▬▬
Maven -
Gradle -

▬▬ CLOUD SERVICES ▬▬
Browserstack -
Saucelabs -
LambdaTest -

▬▬ DATA FORMATS ▬▬
JSON -
XML -

▬▬ OTHERS ▬▬
Virtualization on Windows -
Mock Interviews -

Redis -
Misc -
Tools & Tips -
QnA Friday -
Sunday Special -


Смотрите видео How to Install Java JDK on Mac OS and set JAVA HOME variable онлайн без регистрации, длительностью 13 минут 58 секунд в хорошем hd качестве. Это видео добавил пользователь Automation Step by Step 03 Октябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 26 тысяч раз и оно понравилось 16 людям.