Reputation: 9996
I have tried to run any command in sbt shell for both terminal and Intellij Idea with the same result:
sbt:loom> println("Hello")
[error] Expected ';'
[error] println("Hello")
[error] ^
sbt:loom> println("Hello");
[error] Expected ';'
[error] println("Hello")
[error] ^
sbt:loom> val list = List.apply(1)
[error] Expected ';'
[error] val list = List.apply(1)
[error] ^
How can I run a command in sbt shell?
Upvotes: 1
Views: 724
Reputation: 48430
Use eval
command to evaluate Scala expressions within sbt shell
sbt:foo> eval println("Hello")
Hello
[info] ans: Unit = null
sbt:foo> eval List.apply(1)
[info] ans: List[Int] = List(1)
Upvotes: 4