Installation

Prerequsites

CIDER 0.14.0 (the version current at the writing of this presentation) has the following prerequisites:

Emacs

As noted in the Introduction, this presentation assumes the reader is an active Emacs user and therefore has Emacs installed. If the reader is not an active (or experienced) Emacs user, the tutorial How to Use Emacs, an Excellent Clojure Editor on the Brave Clojure site is recommended.

Java

Clojure is a JVM-based language and therefore requires an installation of Java.

If you do not have Java 1.7 or later installed, install the version of Java appropriate for your OS:

  • OS X (Oracle Java): Instructions | Downloads

  • Windows (Oracle Java): Instructions | Downloads

  • Linux:

    Users of the popular Linux distributions and their derivatives have the choice of either OpenJDK or Oracle Java. In terms of the licensing model and ease of installation (installation via your Linux package manager), OpenJDK is recommended. In terms of support and stability, Oracle Java is recommended.

After you have installed Java, ensure that:

  • JAVA_HOME points to the root of the Java install directory.
  • The Java 'bin' directory is on your PATH.
  • The command java -version returns version 1.7 or higher.

Leiningen

Leiningen is the de facto standard project build/automation tool for Clojure. Leiningen serves the same purpose as make, Maven, Gradle, and Rake do for their respective languages.

For Leiningen-based Clojure projects, CIDER uses Leiningen to launch a Clojure REPL from Emacs.

CIDER also supports Clojure projects that use Boot and Gradle but this tutorial will cover Leiningen.

The standard installation method for Leiningen varies depending on the OS:

  • Linux and Mac OS X (this is the preferred installation method):

    1. Download the lein script
      • curl -O https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
    2. Make the script executable:
      • chmod a+x lein
    3. Ensure that the directory containing the lein script is on your PATH
  • Windows:

    1. Download the lein.bat script

    2. Ensure that the directory containing the lein.bat script is on your PATH

Alternative installation methods:

Finally, validate your Leiningen install:

  • Run lein version to display the Leiningen version.
  • Run lein repl to launch a Clojure REPL. Type (exit) to exit the REPL.

CIDER

CIDER is installed via Emacs' built-in package management facility, package.el (also known as ELPA- Emacs Lisp Package Archive). CIDER is available in the MELPA package repository.

Ensure that you have the following in your Emacs init file (.emacs/.emacs.el/init.el):

(require 'package)

(add-to-list 'package-archives
             '("melpa-stable" . "http://stable.melpa.org/packages/") t)

(package-initialize)

Now install the CIDER package and it's dependencies:

M-x package-install [RET] cider [RET]

Verify CIDER is installed by executing the following:

M-x cider-version [RET]

results matching ""

    No results matching ""