Appendix. Installing Clojure

 

You have a few options for installing a Clojure compiler and read-evaluate-print loop (REPL) to run Clojure code. (A REPL is a programming language’s interactive command line, like a command prompt or terminal shell.) We’ll survey some options in this appendix, and you can find more options at Clojure’s Getting Started page (http://clojure.org/). But most people will want to install Clojure via the project management tool Leiningen (see section A.3).

In almost every case you’ll first need to install Java 1.6 or greater. To check if you have Java installed, open a command prompt and type the following:

$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

If you get an error, or if the first line shows a Java version lower than 1.6, you’ll need to follow the instructions to install Java for your platform (https://www.java.com/en/download/help/download_options.xml). Once you have Java installed, you can follow the instructions shown here to install Clojure.

A.1. Try Clojure

The easiest way to install something is not to install it. Try Clojure (http://www.tryclj.com) is a Clojure REPL you run in your browser. This REPL has two major limitations:

A.2. Clojure.jar

A.3. Leiningen