mac book 搭建开发环境
(1)安装jdk
mac jdk 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
注意:要下载jdk,而不是jre
(2)设置java环境变量
mac booke中安装jdk ,没有让用户选择安装目录,那么jdk安装到了哪里呢?
默认安装到了:
?
/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk
所以设置JAVA_HOME
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home
?
export JAVA_HOME
参考:http://www.cnblogs.com/symen/p/4974408.html
?
(3)安装Foxmail
下载地址:http://www.foxmail.com/mac/en/
?
?
(4)配置hosts
参考:http://laod.cn/hosts/2015-google-hosts.html
(5)下载git代码
需要把git的私钥拷贝到?/Users/whuanghkl/.ssh 下
?
?
?
?
(6)运行IDEA 报错:
Error:java: javacTask: source release 1.7 requires target release 1.7
?解决方法:
进入settings
mac 中使用快捷键 command+逗号
?把1.5改为1.7就好了
?
?(7)安装hosts切换工具
mac下 hosts切换工具:gas mask
下载地址:http://www.macupdate.com/app/mac/29949/gas-mask/download
?
?附件也可以下载
?
(8)安装brew
参考:http://brew.sh/
安装命令:
?
?/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装过程:
localhost:Downloads whuanghkl$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to whuanghkl:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
?
?
Press RETURN to continue or any other key to abort
?
?
?
原文:http://hw1287789687.iteye.com/blog/2286007