我是Scala/SBT的新手,所以请保持温和,但我正在努力通过SBT"入门",我注意到我的brew安装的scala和sbt工具之间存在差异.当我直接为scala启动REPL时,它会将自己报告为Scala 2.10.1,这正是我所期望的.
bobk-mbp:work bobk$ scala
Welcome to Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_17).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :quit
Run Code Online (Sandbox Code Playgroud)
当我通过SBT启动REPL时,REPL断言它是2.9.2?!?
bobk-mbp:work bobk$ sbt console
[info] Set current project to default-690573 (in build file:/Users/bobk/work/)
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_17).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :quit
Run Code Online (Sandbox Code Playgroud)
那是怎么回事?我期待构建工具使用我的开发框上托管的scala环境.它在哪里获得2.9.2以及如何使用它来使用2.10.1?
scala和sbt都是通过brew安装的,但我认为这并不重要.sbt版本似乎是0.12.3
bobk-mbp:work bobk$ sbt --version
sbt launcher version 0.12.3
Run Code Online (Sandbox Code Playgroud)
tre*_*bus 16
如果你没有参数启动sbt:
sbt
> ++ 2.10.1
> console
Run Code Online (Sandbox Code Playgroud)
应该为你提供Scala 2.10.1.我不知道如何在不重建sbt本身的情况下将其作为所有sbt会话的默认值.