Skip to content

Latest commit

 

History

History
105 lines (68 loc) · 2.26 KB

clojure_quickstart.org

File metadata and controls

105 lines (68 loc) · 2.26 KB

Clojure REPL quickstart

There are a few options on how you can start playing with Clojure. Choose one that suits you.

Install Leiningen

Leiningen is what npm is for JavaScript. You can install it in a couple of ways:

From repository:

sudo apt install leiningen

Directly

Follow istructions given here: https://leiningen.org/

Install Clojure

From repository (Linux)

On many Linux distributions, installation is as easy as installing single clojure package. For example, on Ubuntu:

sudo apt install clojure

Via script installer (Linux)

To install with the Linux installer:

  1. Ensure that the following dependencies are installed: bash, curl, rlwrap, and Java.
  2. 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
        

Via Homebrew (MacOS)

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

Installation on Windows

An early release version of clj on Windows is available at clj on Windows. Please provide feedback at https://clojure.atlassian.net/projects/TDEPS.

Local build

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

Try Clojure online

repl.it provides a browser-based Clojure repl for interactive exploration.

Via Docker

Assuming you’ve Docker installed, simply run:

docker run --rm -it clojure lein repl

Starting REPL

If you’ve installed Lein, start REPL with the following command:

lein repl

If you’ve installed Clojure directly, run:

clojure