Setting Environment Variables on Mac

It is essential to set up a list of environment variables that are specific to a specific development environment. Below are the step on how to accomplish this on MacOS: 1. Open a text file and save it as .bash_profile:
# User specific Terminal config if [ -n "$PS1" ]; then PS1='\u@\h:\w \$ '; fi shopt -s checkwinsize echo ~/.bash_profile export PATH=$PATH:/usr/local/bin ####### JAVA DEV ####### export JAVA_HOME=/Library/Java/Home/ export PATH=$PATH:$JAVA_HOME/bin
2. Save .bash_profile under main user directory in the HD. 3. Restart your terminal window. 4. Verify in the terminal that you have the correct path for the env var. you just set up:
echo $JAVA_HOME


As an Amazon Associate I earn from qualifying purchases.

No comments:

Post a Comment

Post Scriptum

The views in this article are mine and do not reflect those of my employer.
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
LinkedIn
Google Scholar

Popular Recent Posts

Most Popular Articles

apt quotation..