Get Clojure

The obvious place to start is with the getting started instructions on Clojure.org which suggest that you download Clojure and run it with a Java command line invocation. This works, but it doesn’t really get you very far in terms of a useful Clojure development environment.

Instead, you’ll need to choose an IDE or editor with Clojure integration. There are links in the Clojure Assembla page to some of those, and I’ve listed the main choices below. There is also a detailed comparison worth a read, but don’t spend so much time tinkering with the tools that you forget to learn the language.

NetBeans

For NetBeans, you can use the Enclojure plugin, which provides a reasonably effective Clojure build and REPL mechanism.

Eclipse

Likewise, CounterClockwise offers a similar feature set for Eclipse.

IntelliJ IDEA

If you’re an IntelliJ IDEA fan, the La Clojure plugin adds at least basic Clojure support

VIM

With VIM your choices are VIMClojure and slimv, both of which aim to provide something similar to SLIME. I do not know why there are two projects, nor which one is farther along; but one reader reported that VimClojure is more complete.

On Windows: Clojure Box

Clojure Box is by far the shortest path to a working Clojure environment on Windows.

All the Cool Kids use Emacs

As you spent even a little time wandering around the Clojure world and getting to know its occupants, you will find that serious Clojure programmers disproportionately use Emacs. While some would claim this is because of Emacs’s obvious superiority, a more straightforward explanation is that the Lisp community has traditionally been Emacs-centric because Emacs its is partially developed in Lisp and customized in Lisp, and Clojure is a Lisp.

Thus, Emacs is currently the most idiomatic way to use Clojure; even if you end up somewhere else, your effort to learn Clojure will probably include using (or learning) Emacs.

To get started, the most popular approach appears to be Phil Hagelberg’s Emacs Starter Kit, including his whole list of setup instrutions.

For Ubuntu users, these instructions are more specific but a bit dated and verbose. I also suggest these shorter instructions, which consist mostly of command-lines to copy-paste.

Phil is also the man behind Leiningen, a Clojure project build tool you will inevitably use to some extent.

But not everyone recommends ESK. The much-esteemed Bradford Cross (cofounder of the incredibly useful FlightCaster) suggests a simpler setup.

COMMENTARY

I’ve tried Eclipse (CCW), NetBeans (Enclojure), Aquamacs, and plain Emacs, all on OSX. Having done all that, I still don’t have a simple answer to the best way to get started. What works best for me is this:

  1. Pick an Emacs, install it.

  2. Install ELPA

  3. Use ELPA to install the Emacs support for Clojure

  4. Install Leiningen

  5. Check project out of source control, use Lein to build it and run Swank, connect to that from Emacs.

But that all sounds like a complex mess to someone outside the Clojure world, which would benefit greatly from a one-step way to get an integrated, complete toolset in place.

-Kyle