Coursier
Installation
Install Coursier by running the following commands.
- Apple Silicon (M1, M2, ...)
- Apple Intel
- Linux x86-64 (AMD64)
- Linux ARM64
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
For Apple Intel Mac,
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-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
For Linux x86-64 (AMD64),
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > cs
chmod +x cs
./cs install cs
{ echo $PATH | grep -q "$HOME/.local/share/coursier/bin" ; } || echo 'PATH="$PATH:$HOME/.local/share/coursier/bin"' >> $HOME/.zshrc
rm cs
For ARM64,
curl -fL "https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-pc-linux.gz" | gzip -d > cs
chmod +x cs
./cs install cs
{ echo $PATH | grep -q "$HOME/.local/share/coursier/bin" ; } || echo 'PATH="$PATH:$HOME/.local/share/coursier/bin"' >> $HOME/.zshrc
rm cs
Update Coursier using Coursier itself.
cs update cs
Install Scala 3
cs install scala3-compiler:3.3.4 scala3-repl:3.3.4
To run Scala3 compiler,
scala3-compiler
e.g.)
scala3-compiler --version
Scala compiler version 3.3.4 -- Copyright 2002-2024, LAMP/EPFL
To run Scala 3 REPL,
scala3-repl
e.g.)
scala3-repl --version
Scala code runner version 3.3.4 -- Copyright 2002-2024, LAMP/EPFL
Uninstallation
If you want to uninstall everything installed by Coursier and Coursier itself, run the following command.
cs uninstall --all