Skip to main content

Setup Scala

caution

This page is reserved for Linux users. Instructions for other operating system can be found in:

Install Scala using Coursier

Coursier is the Scala artifact fetcher, we will use it to install the standard Scala toolbox.

1. Open a terminal.

Open terminal

2. In the terminal, download the cs file:

curl -fLo cs https://git.io/coursier-cli-"$(uname | tr LD ld)"

3. Make the downloaded file executable with:

chmod +x cs
info

The chmod command does not print anything back to you. That's okay.

Other commands below won't print anything either.

4. Execute the cs file to setup scala:

./cs setup --yes

5. Reload your .profile file:

. ~/.profile

6. Finally, you can remove the coursier file:

rm cs

Check the installation of Scala

1. Check that Coursier is installed:

cs --version

It should print:

2.0.16

2. Check that Java is installed:

java -version

It should print something like:

openjdk version "1.8.0_275"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_275-b01)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.275-b01, mixed mode)

3. Check that Scala is installed:

scala -version

It should print:

Scala code runner version 2.13.6 -- Copyright 2002-2021, LAMP/EPFL and Lightbend, Inc.