Scala  : How to install it

Photo by Jexo on Unsplash

Scala : How to install it

·

2 min read

1.choose one install method

• Using Coursier CLI, run:
cs install scala:3.2.1 && cs install scalac:3.2.1.
• Download the Scala binaries for 3.2.1 at github.
• Using SDKMAN!, you can easily install the latest version of Scala on any platform by running the following command:
sdk install scala
• On macOS you can also use Homebrew and run the following commands:
brew update
brew install lampepfl/brew/dotty
• Use Scastie to run single-file Scala programs in your browser using multiple Scala compilers; the production Scala 2.x compilers, Scala.js, Scala 3, and Typelevel Scala. Save and share executable Scala code snippets.

2.Install SDKMAN

I choose SDKMAN.
SDKMAN can be installed on macOS、Linux、Cygwin、Solaris and FreeBSD.

curl -s "https://get.sdkman.io" | bash
source "/home/liyuan/.sdkman/bin/sdkman-init.sh"

scala_install_1.png

scala_install_2.png

3. install scala

sdk install scala

scala_install_3.png

4.install cmd tools for Scala

The Scala installer is a tool named Coursier, whose main command is named cs. It ensures that a JVM and standard Scala tools are installed on your system. Install it on your system with the following instructions.
So I Run the following command on Linux, following the on-screen instructions: curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup

scala_configure_1.png

Then you may need restart the terminal, log out, or reboot in order for the changes to take effect.

Now finished!
I have Scala!

Resources:

docs.scala-lang.org/getting-started/index.h..