Ambiguity in Clojure installation instructions

On the Homebrew formulae site—here—we see the “install command” as brew install clojure. The page links also to, where when you navigate to “Install Clojure” (here), we see the “install command” as brew install clojure/tools/clojure.

So: in one place,
brew install clojure,
and in another,
brew install clojure/tools/clojure.

So which one is it? Anybody know?

I’m setting up a new laptop and it’s given me the opportunity to set up my Clojure workflow from scratch. This question I pose is one of those that make Clojure difficult for beginners, don’t you all agree?

1 Like

Follow the instructions (brew install clojure/tools/clojure). Those are official and correct.

The homebrew instructions have been known to cause issues. The Clojure team has asked the homebrew folks to change the default tap, and the homebrew folks refused:

Clojure maintains its own brew tap and a “stable” release that you can obtain with brew install clojure/tools/clojure (the brew conventions automatically find the prior repo based on that). That tap also includes prerelease unstable versions that can be obtained with “@version” - more on that is doc’ed in the readme for that repo.

Homebrew core is what you are pulling from if you just do brew install clojure. The formula there is no longer maintained by the Clojure team as anyone can update it (and have, with changes we did not agree with). There is no “ownership” model in homebrew-core. I would happily remove it from there but they said they would not accept that PR. Recently, the homebrew-core formula has been updated by members of the homebrew team to newer prerelease (not yet stable) versions of clj. There is not really anything we can do about this.

(Emphasis mine.)

For what it’s worth, the official “Install Clojure” page links to an explanation saying basically the same thing:

This tap is the source of the official Clojure brew formula. The Clojure formula on homebrew-core is not the official formula and is likely to be out of date.

In general, Homebrew is a packaging & distribution tool for software created by others

Homebrew is not necessarily the owner of the software it packages so should never be seen as the canonical source of truth

Whist homebrew is a convenient tool for installing software on a Mac there is no guarantee that it follows the original owners recommendations or provides the correct version or solution

Any tool should be used with consideration

For anyone starting with Clojure, there are a wealth of resources at to help, so should be the official starting point

Just FYI, I do update the homebrew core tap which we do stable release builds to the Clojure tap, so either instruction should give you the same version of the Clojure CLI (modulo some brief in between time immediately after each release while the PR is considered). The formulae differ slightly, particularly in how they handle the jdk requirement but most people will not notice anything different.

So to summarize our talk so far, in using brew install clojure, you run two risks:

  • Some possible problem having to do with the classpath order.
  • That in certain occasions, brew install clojure/tools/clojure will install a more up-to-date version of Clojure (as the Homebrew tap’s update PR is being considered).

I wonder what classpath problems I might run into by using brew install clojure—I guess I’ll find out.

I don’t think you’ll run into any problems with classpath order, why do you think so?