Browse Learn Clojure Foundations as a Java Developer

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.

On macOS, the official Clojure install path uses Homebrew. That fits many Java teams well because it makes setup repeatable and easy to update.

Before installing Clojure, verify Java:

1java -version
2javac -version

Then verify Homebrew:

1brew --version

Install The Clojure CLI

The official install command is:

1brew install clojure/tools/clojure

To upgrade an existing install:

1brew upgrade clojure/tools/clojure

After installation, open a new terminal and verify:

1clojure --version
2clj -h

What Homebrew Installed

The install gives you the Clojure command-line tools, not a separate Clojure operating-system runtime. The tools can download the Clojure language dependency and other JVM libraries as needed.

Command Use
clj Start an interactive REPL
clojure --version Print the CLI version
clojure -Spath Show the computed classpath
brew upgrade clojure/tools/clojure Update the CLI tooling

For Java engineers, the important connection is the classpath. If clojure -Spath works, the CLI can compute the JVM classpath it will use to launch Clojure.

Apple Silicon And Multiple JDKs

On Apple Silicon machines, make sure your JDK, Homebrew install, terminal shell, and editor agree on architecture and paths. Mixed Intel/Rosetta and ARM installations can be confusing.

Check:

1which java
2which clojure
3uname -m

If the terminal works but the editor REPL fails, evaluate this inside the editor-connected REPL:

1(System/getProperty "java.home")
2(System/getProperty "os.arch")

That confirms the JVM the editor actually launched.

Team Notes

For a shared project, document:

  • required Java version
  • Homebrew install command
  • Clojure verification command
  • editor REPL startup command
  • test command

That keeps macOS setup focused on repeatable development instead of personal machine archaeology.

Knowledge Check

### What is the official macOS install command for the Clojure CLI? - [x] `brew install clojure/tools/clojure` - [ ] `npm install clojure` - [ ] `javac install clojure` - [ ] `mvn install clojure-cli` > **Explanation:** Official macOS instructions use the Clojure Homebrew tap. ### Why run `clojure -Spath` after installation? - [x] It confirms the CLI can compute the JVM classpath. - [ ] It formats all source files. - [ ] It installs Homebrew. - [ ] It changes the Java version globally. > **Explanation:** Clojure development depends on predictable classpath construction. ### What should you check if the macOS terminal works but the editor REPL fails? - [x] Which Java home and architecture the editor-connected REPL is using. - [ ] Whether Markdown headings are numbered. - [ ] Whether the browser is open. - [ ] Whether the project has a logo. > **Explanation:** GUI-launched editors may use a different environment than your terminal.
Revised on Saturday, May 23, 2026