Intellij Mac setup

Set JAVA_HOME

Add below lines accordingly to .zshrc

export JAVA_HOME="$(/usr/libexec/java_home -v 1.6)"  
or  
export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)"  
or  
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"  

Click New - Add - JDK

Set M2_HOME

โžœ  ~ mvn -v
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)  
Maven home: /usr/local/Cellar/maven/3.3.3/libexec  
Java version: 1.8.0_51, vendor: Oracle Corporation  
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre  
Default locale: zh_CN, platform encoding: UTF-8  
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"  

Go to Perferences --> Maven --> Maven home directory
Insert the path into the field.

Gradle_HOME

/usr/local/Cellar/gradle/X.X/libexec

ๅ‚่€ƒ