1.先要安裝 JDK,下載地址:html
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
安裝成功後在終端輸入 java –version 能夠看到版本信息即爲安裝成功:java
➜ ~ java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
2.安裝 Scalaoracle
到scala官網,下載scala的sdk,地址:app
http://www.scala-lang.org/download/
解壓:ui
tar -zxvf scala-2.11.7.tgz
將解壓後的文件移到程序安裝路徑:spa
mv scala-2.11.7 ~/linyaolong.app/
在 ~/.zshrc 中加入以下環境配置:scala
export SCALA_HOME=/Users/linyaolong/linyaolong.app/scala-2.11.7 export PATH=$PATH:$SCALA_HOME/bin
應用環境配置:code
source ~/.zshrc
至此 Scala 已成功安裝到 Mac 上,在終端輸入 scala –version 能夠看到成功安裝 Scala 的版本:htm
➜ ~ scala -version Scala code runner version 2.11.7 -- Copyright 2002-2013, LAMP/EPFL