set LEIN_HOME=c:\dev\leiningen
Next you need to run the Leiningen installer:
lein.bat self-install
If you are behind a firewall you can download the standalone jar file, place it in the 'self-installs' directory. That way you won't need to mess with curl or wget.
The rest of Leiningen uses maven, so this is how you get around an http proxy with maven. Create a setting.xml file in your user's home directory within a folder called .m2.
C:\Users\joe_user\.m2\settings.xml:
<settings>
<proxies>
<proxy>
<id>default</id>
<active>true</active>
<protocol>http</protocol>
<host>PROXY_HOST</host>
<port>PROXY_PORT</port>
<username>YOUR_PROXY_USERNAME</username>
<password>YOUR_PROXY_PASSWORD</password>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
</proxies>
</settings>
At this point I'd recommend testing things out from the command line.
Test line.bat to ensure you get the help menu.
Create a new project using lein.bat new.
Pull in dependency's for the project by going into the project directory and running lein.bat deps.
This will test the maven proxy configuration.
Once you have Leiningen setup and installed it's time to setup eclipse. I'm going to refer to the labrepl wiki instructions for setting up Eclipse with counterclockwise. You don't have to go all the way through the instructions since we aren't setting up labrepl, but it wouldn't hurt to install the Git and Maven plugins as well as CounterClockWise, which are all discussed.
Great, now I'm going to refer you to the sexp.posterous blog, which has simple instructions to create the external calls to the Leiningen script from Eclipse. These can then be used by all of your Clojure projects and should only take you about 5 minutes to setup.
Now you have your basic Eclipse-Clojure-Leiningen environment setup and I'll cover general use and some gotchas that I ran into.
The first thing you want to do is create a new Eclipse project. Select the 'Clojure' type for your project. If you don't see this option, then perhaps you didn't get the CounterClockWise plug-in properly installed. It should look like this:
![]() |
New Project Wizard |
We will now run some of the Leiningen external tools you setup earlier. If you have difficulty getting the commands to run, I've found I sometimes have to click on the project name before I run the command, as I'm showing in this pic:
![]() |
External Tools Drop-Down |
Run the Leiningen 'new' command first. This will add some files and folders to the existing Eclipse project. (You may need to refresh the project before they appear.) The files of interest are the project.clj file in the project root and the core.clj files under /src and /test in your project's namespace, which in my case is helloWorld - the same name as the project. It get's this name, based on how we setup the Leiningen 'new' command. You can think of the Clojure namespace being similar to a Java package.
Your setup should now look something like this view from the Eclipse package manager: