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.
On Linux, the official Clojure install guide uses a script installer for the Clojure CLI. This installs command-line tools such as clj and clojure, which then launch JVM processes for REPLs and programs.
Before installing, verify prerequisites:
1java -version
2javac -version
3bash --version
4curl --version
5rlwrap --version
If rlwrap is missing, install it with your distribution’s package manager. It improves interactive REPL line editing for clj.
Use the latest installer script published from the official Clojure install instructions:
1curl -L -O https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh
2chmod +x linux-install.sh
3sudo ./linux-install.sh
The installer creates the command-line tools and installs the CLI support files. The default paths from the official guide include /usr/local/bin/clj, /usr/local/bin/clojure, and /usr/local/lib/clojure.
To install somewhere else:
1sudo ./linux-install.sh --prefix /opt/infrastructure/clojure
Choose a custom prefix only when your team has a reason, such as a controlled infrastructure image. The default install is simpler for a personal development machine.
Open a new shell and run:
1clojure --version
2clj -h
3clojure -Spath
These checks confirm:
| Check | Meaning |
|---|---|
clojure --version |
CLI command is installed |
clj -h |
REPL launcher can start enough to print help |
clojure -Spath |
CLI can compute a classpath |
If these fail, return to Java, PATH, permissions, and prerequisite checks before debugging Clojure code.
Some distributions provide Clojure-related packages. They can be useful in controlled environments, but be careful:
For learning this guide, prefer the official CLI install unless your team standard says otherwise.
For Linux CI or containers, make the Java and Clojure toolchain explicit. A passing local REPL is not enough if CI uses a different base image.
Document: