This will append export 'JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)' into your bash_profile file.
You can set JAVA_HOME in Mac OS X 10,10 or Yosemite by adding the following command in your ~/.bash_profile file, as shown below:Įxport JAVA_HOME= `/usr/libexec/java_home` (remember backticks)Įcho export 'JAVA_HOME= \$(/usr/libexec/java_home -v 1.7)' > ~/.bash_profile