Installing Clojure
Install a Clojure toolchain that lets you start a REPL, resolve dependencies, inspect the JVM classpath, and run small experiments without fighting your environment.
For a Java developer, installing Clojure is less about “getting a language” and more about getting a tight JVM workflow: a launcher, a dependency tool, and a REPL you can attach your editor to.
In modern Clojure, the common default is the Clojure CLI (tools.deps). You will still see Leiningen in older projects, and it is worth being able to recognize both.
What To Verify
- You can start a REPL from the terminal.
- Your editor can connect and evaluate forms.
- You can add a dependency and see it on the classpath.
- You can run tests without fighting the toolchain.
| Tooling piece |
What it gives you |
Java comparison |
| Clojure runtime |
The language libraries and compiler on the JVM |
Similar to adding language/runtime libraries to the classpath |
| Clojure CLI / tools.deps |
Dependency coordinates, aliases, REPL startup, classpath construction |
Closer to a classpath/dependency launcher than a full Maven replacement |
| Leiningen |
Project workflow, dependency resolution, tasks, packaging, plugins |
More like a conventional build tool with project-level commands |
| Editor REPL integration |
Fast evaluation from source buffers |
Replaces much of the compile-run-debug loop with interactive evaluation |
Once this works, later chapters get easier: you can run small experiments, inspect values, and validate claims as you read.
In this section
-
How Clojure Installation Works
Understand what the Clojure CLI installs, how clj and clojure relate to the JVM classpath, and why the CLI version is separate from the Clojure language version.
-
Install Clojure on Windows
Choose between WSL and the Windows Clojure installer, verify Java first, and set up a Windows workflow that matches the Clojure tutorials and tools you plan to use.
-
Install Clojure on macOS
Install the Clojure CLI on macOS with Homebrew, verify Java and brew first, and confirm that clj, clojure, and your editor use the same JVM setup.
-
Install Clojure on Linux
Install the Clojure CLI on Linux with the current official installer script, verify Java, bash, curl, and rlwrap prerequisites, and confirm REPL and classpath behavior.
-
Clojure CLI vs Leiningen
Compare the Clojure CLI with deps.edn and Leiningen with project.clj so Java engineers can run existing projects, choose new-project defaults, and avoid tool migration churn.
-
Install Leiningen
Install Leiningen only when a project or learning path needs it, then verify lein, project.clj, REPL, test, and package commands without confusing it with the Clojure CLI.
-
Verify Your Clojure Installation
Check Java, the Clojure CLI, REPL startup, language version, classpath construction, and optional Leiningen commands before debugging project-specific setup problems.