Installation

nREPL is compatible with Clojure 1.7.0+ and Java 8+.

nREPL is a library (as opposed to it being an application), so it’s not something you’d be installing in the traditional sense. There’s currently no nREPL binary or script that you can run to spin a server.

While there’s no binary, there is a command-line interface that mostly targets clj. It’s documented in the subsequent sections of this manual.

All popular Clojure build tools (Leiningen, Boot, Gradle, Maven) have the ability to run an nREPL server and most of the time you’ll probably simply use nREPL through them and end up using whatever nREPL version they happen to ship.

Still, from time to time you’ll be building a tool around nREPL or you’ll want to embed an nREPL server directly in your application. In those scenarios some kind of an installation will be in order - just adding nREPL as a dependency to your project.

nREPL is available in Clojars. Add this to your Leiningen project.clj :dependencies:

[nrepl "0.8.3"]

You can override the version of nREPL supplied by Leiningen and Boot by adding nREPL as a dependency to your project.

Or, add this to your Maven project’s pom.xml:

<dependency>
  <groupId>nrepl</groupId>
  <artifactId>nrepl</artifactId>
  <version>0.8.3</version>
</dependency>

Prior to version 0.3, nREPL used to be hosted on Maven Central and had a different deployment artifact - org.clojure/clojure.tools.nrepl.

Upgrading from nREPL 0.2.x

A few major changes happened since nREPL 0.2.x:

  • The artifact id changed from org.clojure/clojure.tools.nrepl to nrepl/nrepl.

  • The namespace prefix changed from clojure.tools.nrepl to nrepl.

  • The namespace clojure.tools.nrepl was renamed to nrepl.core.

  • nREPL now targets Java 8+ and Clojure 1.7+.[1]

  • All the code which existed for compatibility with nREPL 0.0.x was removed.[2]

Refer to the changelog for an exhaustive listing of all the changes.

Those changes can affect you in two ways:

  • If you’re working on nREPL extensions you’ll need to update the nREPL namespaces you’re referring to.

  • If you’re using third-party nREPL middleware you’ll have to make sure it was updated for nREPL 0.4+.

Apart from those renamings it’s business as usual - nREPL’s API and protocol remain exactly the same as they were in 0.2.x, and backwards compatibility remains as important as always.

You’ll need Boot 2.8.2+ or Leiningen 2.8.3+ to take advantage of nREPL 0.4+, as their older releases bundled nREPL 0.2.x. Leiningen users can also use the lein-nrepl plugin if they are stuck on an older Leiningen release.


1. nREPL 0.2 used to target Java 6 and Clojure 1.2.
2. Which probably won’t affect anyone, as it was ancient.