How to install an older version of scala

后端 未结 5 1031
一向
一向 2021-02-02 09:59

I currently had installed scala 2.11.7 but in order to fix this issue, I have to install a older version of scala(2.10.5). When I try to install with b

5条回答
  •  北海茫月
    2021-02-02 10:59

    If you manage your project with sbt, the scala built tool, either directly or via IntelliJ, the version of scala for that code is defined in the build file (build.sbt or Build.scala):

    scalaVersion  := "2.10.5"
    

    Choosing this path, there isn't even a need to install scala on your Mac at all. Each project will have its own version -- pulled from your local ivy repository, so it doesn't have to download it each time.

    And rather than typing scala to get to the REPL, you type sbt console to get to the REPL with the project's scala version and dependencies loaded.

提交回复
热议问题