This adds the commands clojure and clj to your system from the clojure/tools tap:
brew install clojure/tools/clojurePrerequisites: Java, bash, curl, rlwrap
To install with Linuxbrew (requires brew):
brew install clojure/tools/clojureTo install with the Linux script installer:
-
Ensure that the following dependencies are installed:
bash,curl,rlwrap, andJava. -
Use the
linux-installscript to download and run the install, which will create the executables/usr/local/bin/clj,/usr/local/bin/clojure, and the directory/usr/local/lib/clojure:
curl -O https://download.clojure.org/install/linux-install-1.11.1.1273.sh
chmod +x linux-install-1.11.1.1273.sh
sudo ./linux-install-1.11.1.1273.shTo install to a custom location (like /opt/infrastructure/clojure), use the option --prefix:
sudo ./linux-install-1.11.1.1273.sh --prefix /opt/infrastructure/clojureYou may also want to extend the MANPATH in /etc/man_db.conf to include the manual pages:
MANPATH_MAP /opt/infrastructure/clojure/bin /opt/infrastructure/clojure/manThe linux-install script can be removed after installation.
A POSIX version of the linux installer is now available as well. This installer should work on Linux, BSD, and even Mac (but will conflict with brew!)
To install with the POSIX script installer:
-
Ensure that the following dependencies are installed:
bash,curl,rlwrap, andJava. -
Use the
posix-installscript to download and run the install, which will create the executables/usr/local/bin/clj,/usr/local/bin/clojure, and the directory/usr/local/lib/clojure:
curl -O https://download.clojure.org/install/posix-install-1.11.1.1273.sh
chmod +x posix-install-1.11.1.1273.sh
sudo ./posix-install-1.11.1.1273.shTo install to a custom location (like /opt/infrastructure/clojure), use the option --prefix:
sudo ./posix-install-1.11.1.1273.sh --prefix /opt/infrastructure/clojureYou may also want to extend the MANPATH in /etc/man_db.conf to include the manual pages:
MANPATH_MAP /opt/infrastructure/clojure/bin /opt/infrastructure/clojure/manThe posix-install script can be removed after installation.
Prerequisites: Java
An early release version of clj on Windows is available at clj on Windows. Please provide feedback on Ask Clojure or Clojurians slack in #clj-on-windows.
brew is a package manager for Mac OS X or Linux. To install brew:
-
Go to https://brew.sh/ and follow the installation instructions for your OS
Clojure requires Java. Clojure officially supports Java LTS releases (currently Java 8, 11, and 17), but also tries to ensure interim versions work as well. You can use any Java distribution, whether it’s a commercial release from Oracle or an open source version based on OpenJDK (like Temurin). The Clojure tools require only that the java command is on the PATH or that the JAVA_HOME environment variable is set.
If you don’t already hava Java installed, we recommend installing Adoptium Temurin 17.
To use the Adoptium Temurin installers:
-
Go to https://adoptium.net/
-
Download and run the installer appropriate to your platform
-
Ensure
javais on the system PATH
On Mac, you can also install Temurin using brew:
-
brew tap homebrew/cask-versions- add the cask-versions tap to Homebrew -
brew install --cask temurin17- install Temurin 17 (formerly AdoptOpenJDK)
Check your Java version by running java --version. If that’s not Temurin 17, then you may then need to add java to your PATH:
echo 'export PATH="/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin:$PATH"' >> ~/.zshrcFor other versions of the Clojure command-line tools, see the changelog for version history and the Clojure tap for info on installing older versions or newer prereleases instead.