If you want to define a system variable in Mac OS X, and you want all of your applications (commandline, GUI, ...) to be able to pick them up - then you need to follow the steps:
- Open a terminal
- Execute the command:
Remark: In my case, the file didn't exist, so don't worry if you need to create it$ sudo nano /etc/launchd.conf
- Insert the following text (I added 2 examples: JAVA_HOME and JREBEL_HOME)
# Set environment variables here so they are available globally to all apps # (and Terminal) # # After editing this file run the following command from the terminal to update # environment variables globally without needing to reboot. # NOTE: You will still need to restart the relevant application (including # Terminal) to pick up the changes! # grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl setenv JAVA_HOME /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home setenv JREBEL_HOME /Applications/eclipse/plugins/org.zeroturnaround.eclipse.embedder_5.0.1.RELEASE-201207191833/jrebel
Add new comment