Skip to main content

Coursier

Installation

Install Coursier by running the following commands.

For Apple Silicon (M1, M2, ...)

curl -fL "https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-apple-darwin.gz" | gzip -d > cs
chmod +x cs
./cs install cs
{ echo $PATH | grep -q "$HOME/Library/Application Support/Coursier/bin" ; } || echo 'PATH="$PATH:$HOME/Library/Application Support/Coursier/bin"' >> $HOME/.zshrc
rm cs

Update Coursier using Coursier itself.

cs update cs

Install Scala 3

cs install scala3-compiler scala3-repl

To run Scala3 compiler,

scala3-compiler

e.g.)

scala3-compiler --version
Scala compiler version 3.3.1 -- Copyright 2002-2023, LAMP/EPFL

To run Scala 3 REPL,

scala3-repl

e.g.)

scala3-repl --version
Scala code runner version 3.3.1 -- Copyright 2002-2023, LAMP/EPFL

Uninstallation

If you want to uninstall everything installed by Coursier and Coursier itself, run the following command.

cs uninstall --all