$ mkdir foo-build
$ cd foo-build
$ touch build.sbt
$ sbt
...
sbt:foo-build>
...
sbt:foo-build> compile
sbt:foo-build> run
[info] Packaging ~/Development/projects/research/scala/foo-build/target/scala-2.12/foo-build_2.12-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] Running example.Hello
Hello
[success] Total time: 0 s, completed Aug 4, 2018, 12:10:41 PM
sbt:foo-build> scalaVersion
[info] 2.12.6
sbt:foo-build> session save
[info] No session settings defined.
我希望遵循文档
Save the session to build.sbt
We can save the ad-hoc settings using session save.
sbt:foo-build> session save
[info] Reapplying settings...
build.sbt file should now contain:
ThisBuild / scalaVersion := "2.12.6"