Skip to content

Instantly share code, notes, and snippets.

@nimeshneema
Created February 28, 2026 00:25
Show Gist options
  • Select an option

  • Save nimeshneema/75731ff99e20d4e413b9414e3bbe9509 to your computer and use it in GitHub Desktop.

Select an option

Save nimeshneema/75731ff99e20d4e413b9414e3bbe9509 to your computer and use it in GitHub Desktop.
# Java (Metals requires JDK 11 or 17, prefer 17)
sudo apt update
sudo apt install -y openjdk-17-jdk curl wget git
# Verify
java -version # should show 17.x
# coursier (the Scala installer/launcher - used to install Metals)
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > ~/.local/bin/cs
chmod +x ~/.local/bin/cs
# Make sure ~/.local/bin is in your PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Bootstrap coursier itself
cs setup --yes
# After cs setup, your PATH will include ~/.local/share/coursier/bin
# Source again or open a new terminal
source ~/.bashrc
# Verify coursier
cs version
# Install sbt (build tool)
sudo apt install -y apt-transport-https
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt update
sudo apt install -y sbt
# Verify sbt
sbt --version
# scalafmt standalone (optional, Metals manages its own but handy to have)
cs install scalafmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment