Skip to content
AgileLogics
4 min read

Installing Clojure

Clojure runs on the JVM, so install a Java Development Kit first — Java 21 or 25 (long-term-support releases) are good choices. Check with java -version.

Then install the official Clojure CLI, which provides the clj and clojure commands.

macOS (and Linux with Homebrew)

brew trust clojure/tools
brew install clojure/tools/clojure

Linux

curl -L -O https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh
chmod +x linux-install.sh
sudo ./linux-install.sh

The script installs clj and clojure into /usr/local/bin. It needs bash, curl, and rlwrap (for line editing in the REPL).

Windows

The recommended route is WSL (Windows Subsystem for Linux) with the Linux instructions above — it matches most tutorials. Alternatively, the clj-msi installer adds a native clojure.exe.

Check it works

$ clj -M -e "(clojure-version)"
"1.12.6"

The first run downloads Clojure itself from Maven Central into ~/.m2, so it takes a moment.

Leiningen

Leiningen (lein) is the older, still very popular build tool. Many tutorials and projects use it; Level 3 covers both. You don't need it to start.

Running Clojure with only Java

Clojure is a normal Java library. With the clojure jar and its two small dependencies (spec.alpha and core.specs.alpha) from Maven Central, you can run a file directly — this is how this course's examples were checked:

java -cp "clojure-1.12.6.jar;spec.alpha-0.5.238.jar;core.specs.alpha-0.4.74.jar" clojure.main main.clj

(Use : instead of ; between jars on macOS and Linux.)