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.
Leiningen is a Clojure project automation tool. It manages dependencies, starts REPLs, runs tasks, creates projects, and packages applications. It is not obsolete just because the current official Clojure docs emphasize the Clojure CLI. Many real repositories still use Leiningen.
Install it when:
project.cljleinDo not install it because every Clojure project must use it. New projects can also use the Clojure CLI and deps.edn.
The Leiningen site recommends installing Leiningen through your package manager when possible. That is usually better than copying a random script from an old blog post.
| Platform | Practical route |
|---|---|
| macOS | Homebrew or team-standard package manager |
| Linux | Distribution package, Homebrew on Linux, or team-standard install |
| Windows | Team-standard package manager or documented Windows setup |
| CI | Explicit setup step or image with lein installed |
After installation:
1lein --version
2lein help
If those commands fail, fix Leiningen discovery before debugging project dependencies.
| Command | Purpose |
|---|---|
lein repl |
Start a REPL with the project classpath |
lein test |
Run project tests |
lein run |
Run the configured main namespace |
lein uberjar |
Build a standalone jar when configured |
lein help tutorial |
Read the built-in tutorial |
For Java engineers, Leiningen will feel closer to Maven or Gradle than the Clojure CLI does because it exposes named tasks. The configuration is still Clojure data, and the runtime is still the JVM.
In a project with project.clj, run:
1lein repl
2lein test
If the REPL starts but tests fail, Leiningen is installed; now debug the project. If lein itself is not found, debug installation or PATH.
Some machines have both clojure and lein. That is normal. The project decides which one matters.
| Project file | Start here |
|---|---|
deps.edn |
Clojure CLI commands |
project.clj |
Leiningen commands |
| both files | Read the project README or CI config |
| neither file | Look for Maven/Gradle or a custom script |
Do not mix commands randomly. A REPL launched with clj may not have the same classpath as one launched with lein repl.