Requires JDK 6 or newer.
The easiest way to get started with Clojure is to download and install Leiningen, the de facto standard tool to manage Clojure projects, then run lein repl
to open a REPL.
curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > ~/bin/lein export PATH=$PATH:~/bin chmod 755 ~/bin/lein
Follow Linux steps above or install with macOS package managers.
brew install leiningen
First install Clojure
sudo port -R install clojure
Install Leiningen
, a build tool for Clojure
sudo port -R install leiningen
lein self-install
See the official documentation.
Requires JRE 6 or newer.
Clojure releases are published as simple JAR files to be run on the JVM. This is what typically happens inside the Clojure build tools.
Go to http://clojure.org and download the latest Clojure archive
Extract the downloaded ZIP file into a directory of your choice
Run java -cp clojure-1.8.0.jar clojure.main
in that directory
You may have to substitute the clojure-1.8.0.jar
in that command for the name of the JAR file that you actually downloaded.
For a better command-line REPL experience (e.g. cycling through your previous commands), you might want to install rlwrap
: rlwrap java -cp clojure-1.8.0.jar clojure.main
Requires JDK 7 or newer.
Boot is a multi-purpose Clojure build tool. Understanding it requires some knowledge of Clojure, so it may not be the best option for beginners. See the website (click Get Started there) for installation instructions.
Once it's installed and in your PATH
, you can run boot repl
anywhere to start a Clojure REPL.