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.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles