Browse Learn Clojure Foundations as a Java Developer

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.

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.

Official Linux Installer Flow

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.

Verify After Installation

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.

Linux Distribution Packages

Some distributions provide Clojure-related packages. They can be useful in controlled environments, but be careful:

  • the packaged version may lag official CLI releases
  • package names differ by distribution
  • some packages install language artifacts but not the same CLI workflow
  • documentation and tutorials usually assume the official CLI behavior

For learning this guide, prefer the official CLI install unless your team standard says otherwise.

CI And Containers

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:

  • Java version
  • Clojure CLI install method
  • dependency cache behavior
  • command to run tests
  • command to start a REPL locally

Knowledge Check

### Which prerequisites does the official Linux install path expect? - [x] Java, bash, curl, and rlwrap. - [ ] Node, npm, and Python only. - [ ] Maven Central credentials for every dependency. - [ ] A global CLASSPATH. > **Explanation:** The official Linux CLI installer depends on shell/network tooling and Java. ### Why prefer the official CLI installer while learning? - [x] It matches the behavior expected by current Clojure docs and many tutorials. - [ ] Distribution packages never work. - [ ] The JVM cannot run packaged software. - [ ] Leiningen requires it. > **Explanation:** Distribution packages vary. The official CLI path keeps the learning environment aligned with the docs. ### What does `clojure -Spath` verify? - [x] The CLI can build the JVM classpath for the current configuration. - [ ] The Linux kernel version. - [ ] The editor theme. - [ ] The Java compiler output directory. > **Explanation:** Classpath construction is central to Clojure CLI workflows.
Revised on Saturday, May 23, 2026