Browse Learn Clojure Foundations as a Java Developer

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.

Installing Clojure is not like installing a separate runtime beside the JVM. Clojure is a JVM language, and the language itself is distributed as a JAR dependency. The Clojure command-line tools give you convenient commands for starting a REPL, building classpaths, downloading dependencies, and running Clojure code.

For a Java engineer, the useful mental model is:

Piece What it is Java comparison
Clojure language A JVM library artifact, usually from Maven Central A dependency such as org.clojure/clojure
Clojure CLI The command-line tooling behind clojure and clj A launcher/classpath tool, not a full Maven clone
deps.edn Data configuration for dependencies, paths, and aliases A lighter classpath/dependency descriptor
REPL A live JVM process with Clojure loaded More like an interactive debugger console than jshell

CLI Version Versus Language Version

The official Clojure install guide treats the Clojure CLI version and Clojure language version as separate. That distinction matters in real projects:

  • the CLI has its own version number
  • the language dependency has its own version number
  • any CLI version can download and use different Clojure language versions
  • the leading parts of the CLI version indicate the default language version used by a plain REPL unless project configuration says otherwise

This is different from many Java tool installs, where the command version and language/runtime version feel tightly bundled.

clj Versus clojure

You will see two commands:

1clj
2clojure

Use clj for interactive REPL work when it is available. Use clojure when running explicit command-line operations, scripts, or aliases. They are closely related, but clj is the friendlier interactive entry point on platforms where it wraps line-editing behavior.

What A Successful Install Gives You

After the CLI is installed, you should be able to:

1clojure --version
2clj -h
3clojure -Spath

These prove different things:

Command What it verifies
clojure --version The CLI command is installed and can report its tooling version
clj -h The interactive REPL command can start far enough to print help
clojure -Spath The CLI can compute a JVM classpath

If Java is missing or misconfigured, Clojure commands will fail before your code is involved. Always verify Java first.

The Installation Goal

The goal is not to memorize installer details. The goal is to reach a stable loop:

  1. Java is on the path.
  2. clojure and clj are available.
  3. a REPL starts.
  4. dependencies resolve.
  5. your editor can connect to the same project JVM.

Once those are true, you can learn Clojure by evaluating real code instead of guessing from static examples.

Knowledge Check

### What does the Clojure CLI primarily help you do? - [x] Start REPLs, run Clojure code, compute classpaths, and download dependencies. - [ ] Replace the JVM with a native Clojure runtime. - [ ] Compile Java source files automatically. - [ ] Install every editor plugin. > **Explanation:** The CLI is a JVM-oriented command-line tool. It launches Clojure work on top of Java rather than replacing Java. ### Why can the CLI version differ from the Clojure language version in a project? - [x] The CLI tooling and language dependency are separate layers. - [ ] Clojure projects cannot choose a language version. - [ ] Java forbids versioned dependencies. - [ ] Leiningen must always choose the language version. > **Explanation:** A project can specify the Clojure language artifact it needs, even though the CLI itself has its own version. ### Which command is usually the friendlier interactive REPL entry point? - [x] `clj` - [ ] `javac` - [ ] `jar` - [ ] `mvn` > **Explanation:** On platforms where it is available, `clj` is intended for interactive REPL use.
Revised on Saturday, May 23, 2026