← Back to Scala Course | Chapter 1: Setup & Basics | Lesson 2 of 8

Installing Scala

In this page:

  1. Installing Scala

Installing Scala

Scala runs on the JVM, so a JDK must be installed first, followed by the Scala toolchain itself (compiler, REPL, and build tools). Most developers install Scala via coursier (the cs command) or a package manager. Once installed, scala and scalac become available on your PATH.

Note: Run scala -version after installing to confirm both the JVM and Scala toolchain are set up correctly.

Example: Installing Scala

bash
# Linux (using coursier)
curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs
chmod +x cs && ./cs setup

# macOS (Homebrew)
brew install scala

# Windows (Chocolatey)
choco install scala

# Verify installation (all platforms)
scala -version

⚠️ Run this command in your terminal.

🔒

Chapter Quiz — Complete all 8 topics to unlock

0/8 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.