There are a few options on how you can start playing with Clojure. Choose one that suits you.
Leiningen is what npm is for JavaScript. You can install it in a couple of ways:
sudo apt install leiningen
Follow istructions given here: https://leiningen.org/
On many Linux distributions, installation is as easy as installing
single clojure
package. For example, on Ubuntu:
sudo apt install clojure
To install with the Linux installer:
- Ensure that the following dependencies are installed: bash, curl, rlwrap, and Java.
- Use the linux-install script to download and run the install, which will
create /usr/local/bin/clj, /usr/local/bin/clojure, and /usr/local/lib/clojure:
curl -O https://download.clojure.org/install/linux-install-1.10.1.561.sh chmod +x linux-install-1.10.1.561.sh sudo ./linux-install-1.10.1.561.sh
Install the command line tools with brew from the clojure/tools tap:
brew install clojure/tools/clojure
If you’ve already installed, you can upgrade to the latest release with:
brew upgrade clojure/tools/clojure
An early release version of clj on Windows is available at clj on Windows. Please provide feedback at https://clojure.atlassian.net/projects/TDEPS.
Download and build Clojure from source (requires Git, Java, and Maven):
git clone https://github.com/clojure/clojure.git
cd clojure
mvn -Plocal -Dmaven.test.skip=true package
Then start the REPL with the local jar:
java -jar clojure.jar
repl.it provides a browser-based Clojure repl for interactive exploration.
Assuming you’ve Docker installed, simply run:
docker run --rm -it clojure lein repl
If you’ve installed Lein, start REPL with the following command:
lein repl
If you’ve installed Clojure directly, run:
clojure