ポイント
- SBTがあればとりあえずScalaのライブラリをダウンロードしたりコンソールで試したりする環境がつくれます
- SBTはHomebrewのbrewとして登録されています
手順
既にHomebrewをインストールしているひと
$ brew update
SBTのインストール
SBT(Scala Build Tool)をHomebrewでインストールします。
$ brew install sbt
SBTの動作確認
$ mkdir scala-playground $ cd scala-playground
$ sbt console
[info] Set current project to scala-repl-with-libs (in build file:/Users/yusuke.kuoka/sandbox/scala-repl-with-libs/) [info] Updating {file:/Users/yusuke.kuoka/sandbox/scala-playground/}scala-playground... [info] Resolving org.fusesource.jansi#jansi;1.4 ... ← SBTやプロジェクトが必要とするライブラリを自動的にダウンロードしている [info] Done updating. [info] Starting scala interpreter... [info] Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45). Type in expressions to have them evaluated. Type :help for more information. scala>
scala> println("Hello World!") Hello World! scala>