[英]Quickly switching Scala versions from CLI
nvm
(Node Version Manager) enables quick selection of alternative Node version to work with. nvm
(节点版本管理器)可以快速选择要使用的备用节点版本。 Does Scala have a similar way of quickly switching different versions in the current shell? Scala 是否有类似的方式在当前 shell 中快速切换不同版本? For example, say I want to start REPL with 2.12.10, then executing something something like例如,假设我想用 2.12.10 启动 REPL,然后执行类似
scala use 2.12.10
would greet with会打招呼
Welcome to Scala 2.12.10 (OpenJDK 64-Bit Server VM, Java 1.8.0_202).
Type in expressions for evaluation. Or try :help.
Note the question is not about SBT via scalaVersion
, but using scala
command directly from the command line.请注意,问题不是关于 SBT 通过scalaVersion
,而是直接从命令行使用scala
命令。
dwijnand/scala-runners dwijnand/scala-runners
An alternative implementation of the Scala distribution's runners:
scala
,scalac
,scaladoc
, andscalap
(no fsc). Scala 发行版运行器的另一种实现:scala
、scalac
、scaladoc
和scalap
(无 fsc)。 They are implemented as thin shell scripts around Coursier's coursier launch to add some Scala runners-specific (power) options.它们在 Coursier 的 coursier 发布周围实现为瘦 shell 脚本,以添加一些特定于 Scala 运行程序的(电源)选项。
provide a quick way of starting different versions提供一种快速启动不同版本的方法
scala --scala-version 2.12.10
and even development versions from甚至开发版本
https://scala-ci.typesafe.com/artifactory/scala-integration
https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots
for example例如
scala --scala-version 2.13.2-bin-81d1da3
or particular pull request或特定的拉取请求
scala --scala-pr 8960
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.