Sample Header Ad - 728x90

How do I set environment variables on OS X?

173 votes
12 answers
877106 views
I have always difficulties setting the Environment variables in OS X like JAVA_HOME, M2_HOME or PATH. How to set these on OS X Mavericks? I did some research but the answers I've found didn't really help me yet: 1. export JAVA_HOME=/... (But it seems that the changes are temporary, just for one terminal session.) 2. setenv JAVA_HOME=/... (But command not found.) 3. Open .profile and write the variables inside to make the changes permanent- (.profile does not exist). 4. Open .bash_profile and write the variables inside to make the changes permanent- (.bash_profile does not exist). 5. vi ~/.bash_profile (Quite a challenge for somebody who doesn't know vi.) 6. Creating your own enrivonment.plist file. Can somebody please walk me through the steps to get that to work on OS X Mavericks, assuming *no* Unix knowhow?
Asked by akcasoy (1959 rep)
Oct 25, 2013, 01:13 PM
Last activity: Oct 12, 2023, 02:11 PM