Reputation: 10204
I need to install the scala interpreter (aka repl). The official website https://scala-lang.org/download/ gives me instructions on how to install sbt. I have installed sbt, but still do not have the interpreter. What am I missing here? I am supposed to type scala followed by the Enter key.
[Edit] Someone suggested me to type "console" after sbt is running, but I got an error message
sbt:slides> console
[info] Compiling 1 Scala source to /Users/zell/slides/target/scala-2.12/classes ...
[error] /Users/zell/slides/examFakeSolution.scala:108:10: not found: value fpinscala
[error] import fpinscala.monoids.Monoid
[error] ^
[error] /Users/zell/slides/examFakeSolution.scala:128:45: not found: type Monoid
[error] def foldBack[A] (l :List[A]) (implicit M :Monoid[A]) :A =
[error]
....
Upvotes: 1
Views: 243
Reputation: 7928
If you have sbt, you have the REPL. You are doing it right, you can run sbt
and then console
or directly run sbt console
The error is a compilation error. Fix it first and then you'll be able to run the REPL in that folder.
When you run the REPL, sbt tries to compile the project first. So you can also run it in any folder other than the one from the project and it will work fine.
Upvotes: 1
Reputation: 10671
If you want start scala REPL inside SBT, type sbt
firstly, then console
To start REPL without installing SBT, download the Scala from official site, add %SCALA_HOME%/bin
to PATH
and type scala
in the terminal.
Upvotes: 1