I read Mortimer's answer here http://ift.tt/1wqHXV3 and added this file in /Users/MyName/Library/LaunchAgents called environment.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://ift.tt/vvUEPL">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv GRADLE_HOME /Applications/gradle-2.0
launchctl setenv JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Restarted my laptop, opened a terminal, and ran echo $GRADLE_HOME but it is still blank. How do I set an env var that is persistent throughout terminal sessions in Mac OS 10.10?
Aucun commentaire:
Enregistrer un commentaire