Homebrew Tap for Clojure
Using a Clojure-specific tap (vs the homebrew core tap) allows the Clojure team to retain full control over the Clojure formula, the timing of releases, and an archive of old versions.
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.
The Clojure tools (clj
/clojure
) use a versioning scheme CLOJURE_VERSION.COMMITS (like "1.10.1.507"). The Clojure version is a prefix of the Clojure tools version for three reasons:
- It is a relative indicator of the general age of the tools release.
- It is the version of Clojure used by the tools themselves to compute classpaths.
- If you do not specify a Clojure version in your dependencies (or don't have a deps.edn file), this is the version of Clojure that will be used.
Importantly though, your own deps.edn file controls the version of Clojure that your program, library, or REPL will use! ANY version of Clojure can be used with ANY version of the Clojure tools.
There are three different installation use cases supported by this tap - stable tool releases, dev tool releases, and version archive tool releases.
Most users should use a stable release, defined by the clojure
formula. In general, the stable version will be updated every 2-3 months.
To install/upgrade/uninstall the stable Clojure tools from the Clojure tap:
brew install clojure/tools/clojure
brew upgrade clojure/tools/clojure
brew uninstall clojure
Note: Clojure formulas use "devel" blocks which have been deprecated by brew. Moving forward we'll be removing these but for now, it is only a warning so proceed, everything is fine!
brew has deprecated the --devel release functionality - use the versioned releases in the next section instead.
Occasionally it may be useful to install a specific version of the Clojure tools, particularly dev releases before they become stable. In this case, you can use this archive of @ versions.
Note that you cannot install both the stable or dev version AND a specific named version - these will conflict. You must brew uninstall clojure/tools/clojure
first before installing a specific version. There are various cases where you may still have uninstalled but linked versions - in those cases brew
will give you helpful errors and tell you what to do.
To install/uninstall a versioned Clojure tools from the Clojure tap:
brew install clojure/tools/[email protected]
brew uninstall [email protected]
Please see the following docs on how to use the clj
and clojure
scripts: