mac book 搭建開發環境
(1)安裝jdk
注意:要下載下傳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
class_path="$java_home/lib"
path=".:$path:$java_home/bin"
參考:http://www.cnblogs.com/symen/p/4974408.html
(3)安裝foxmail
下載下傳位址:http://www.foxmail.com/mac/en/

(3)安裝airmail2
airmail2 是一個郵件用戶端
(4)配置hosts
參考:http://laod.cn/hosts/2015-google-hosts.html
需要把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:
==> the following directories will have their group set to admin:
press return to continue or any other key to abort
更新brew
brew update
安裝mounty
brew install caskroom/cask/mounty
(9)設定安全級别,友善安裝app
有時候安裝mac 軟體時,提示無法安裝或無法打開:
解決方法:設定為anywhere
設定之前,先需要點選
解鎖
見附件
(10)安裝alfred
參考:http://www.jianshu.com/p/957a45a8b8f2
需要設定alfred兩個地方:
(a)設定開機自啟動
(b)啟動剪切闆功能
(11)設定mac 中path環境變量
mac中的指令都會去path中找
注意是大寫的path,而不是path,與linux不同.
配置maven的時候就被坑了.
下面是我mac中/etc/profile的配置:
# system-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${bash-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
java_home=/library/java/javavirtualmachines/jdk1.8.0_77.jdk/contents/home
export java_home
m2_home=/users/admin/software/apache-maven-3.3.9
export m2_home
path=$path:$java_home/bin:$m2_home/bin
export path
alias ll='ls -l'
alias la='ls -a'
alias pd='pwd'
alias cdup='cd ..'
alias cd-='cd -'
nginx -c /usr/local/etc/nginx/nginx.conf