Installing Scala
Installing Scala is like getting your art supplies before painting. Scala runs on top of Java's engine, so you install that first and then add Scala on top.
In this page:
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
# 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 in your own terminal or Node.js environment.
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
Common Mistakes
- Installing Scala without a JDK first, so the
scalaorscalaccommand fails because there is no Java runtime. - Not opening a new terminal after installation, so
scalais reported ascommand not foundbecause the PATH was not refreshed. - Installing a very new Scala version while using an old JDK, when the two must be compatible.
🔒
Chapter Quiz — Complete all 8 topics to unlock
0/8 topics done
Complete these topics first: