nvm
(Node Version Manager) enables quick selection of alternative Node version to work with. Does Scala have a similar way of quickly switching different versions in the current shell? For example, say I want to start REPL with 2.12.10, then executing something something like
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.
Alternatively to scala-runners, there's also sdkman, which is a more general tool but also supports scala. For example, command:
sdk use scala 2.12.10
sets scala to 2.12.10 for current shell session.
dwijnand/scala-runners
An alternative implementation of the Scala distribution's runners:
scala
,scalac
,scaladoc
, andscalap
(no fsc). They are implemented as thin shell scripts around Coursier's coursier launch to add some Scala runners-specific (power) options.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With