Bruno is right on track. I've done extensive research and if you want to set variables that are available in all GUI apps, your only option is /etc/launchd.conf
Please note that environment.plist does not work for applications launched via Spotlight. This is documented by Steve Sexton here.
1) Open a terminal prompt
2) Type sudo vi /etc/launchd.conf
3) Put contents like the following into the file
setenv JAVA_VERSION 1.6
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
setenv GROOVY_HOME /Applications/Dev/groovy
setenv GRAILS_HOME /Applications/Dev/grails
setenv NEXUS_HOME /Applications/Dev/nexus/nexus-webapp
setenv JRUBY_HOME /Applications/Dev/jruby
setenv ANT_HOME /Applications/Dev/apache-ant
setenv ANT_OPTS -Xmx512M
setenv MAVEN_OPTS -Xmx1024M
setenv M2_HOME /Applications/Dev/apache-maven
setenv JMETER_HOME /Applications/Dev/jakarta-jmeter
4) Save your changes in VI and reboot your Mac.
5) Prove that your variables are working by opening a Terminal window and typing export
and you should see your new variables. These will also be available in IntelliJ and other GUI apps you launch via Spotlight.