How to install a dependency in a Clojure project
project.clj files specify the project configuration for leiningen.
Leiningen downloads and installs the dependencies specifies in the project.clj file and starts the project / runs the repl process / compiles the project to a java jar / whatever. See the link above. In short, leiningen is the most popular glue between your basic OS and the basic java-based clojure runtime/compiler.
Normally, you should not have to install any clojure libs (or even clojure). Except when you need additional libs to develop/debug the current project (and often you don't), you just install leiningen, and leiningen will install the dependencies for the project you want to run.
To be more specific: leiningen gets its download locations/install instructions by delegating to maven, which is a very interesting project. But possibly not worth looking into too closely if your time is precious.
Edit project.clj and add the dependency (the vector of project-identifying info and version) to the :dependencies vector in project.clj.
The dependency declaration looks like this: [seesaw "1.4.2"]
Which you find by searching for seesaw on http://clojars.org.
Your project file should at minimum look something like:
(defproject my-awesome-gui-application "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.4.0"]
[seesaw "1.4.2"]])
If you are using a newer version of leiningen you can type lein deps :tree
to see your dependency tree. In other words you can see what libraries are actually being used, ie. the ones you declared and their transitive dependencies.
$ lein deps :tree
[org.clojure/clojure "1.4.0"]
[seesaw "1.4.2"]
[com.jgoodies/forms "1.2.1"]
[com.miglayout/miglayout "3.7.4"]
[j18n "1.0.1"]
[org.fife.ui/rsyntaxtextarea "2.0.3"]
[org.swinglabs.swingx/swingx-core "1.6.3"]
[org.swinglabs.swingx/swingx-action "1.6.3"]
[org.swinglabs.swingx/swingx-autocomplete "1.6.3"]
[org.swinglabs.swingx/swingx-common "1.6.3"]
[org.swinglabs.swingx/swingx-painters "1.6.3"]
[org.swinglabs.swingx/swingx-plaf "1.6.3"]
If you are using an older version of leiningen, type lein deps
and look in ./libs to see what jars got fetched (newer versions of lein are smarter and use the jars in ~/.m2 directly instead of copying them into your project. The directory ~/.m2 is the location of your local Maven repository. Leiningen deals with Maven and downloads all the dependencies you've specified so that you don't have to worry about Maven directly.)
I mentioned Maven and your local maven repository in ~/.m2. With any luck you may never have to think about Maven at all (except perhaps browsing through maven central to look up Java libs to stick in your project.clj), but there are times when you might suspect that a jar was corrupted or something to that effect, and it is good to know that you can just blow away that state by deleting your .m2 repository.