Philip Potter

Opening a leiningen project in eclipse

Posted on 16 November 2011

I was wanting to play around with counterclockwise, the eclipse plugin for clojure, recently, when I got stuck trying to open an existing leiningen project in eclipse. If I were coding Java, I’d have no trouble with the analagous problem of importing a maven project into IntelliJ, but I struggled a bit with this one enough that I thought I’d miniblog it so I’d remember in future.

This post assumes you have Leiningen, eclipse and counterclockwise installed.

Install the lein-eclipse plugin. (You may want to check the latest version on clojars. As of writing, there seems to be a rival 1.1.0 from robertrolandorg; I’m not sure of the difference.

$ lein plugin install lein-eclipse 1.0.0
Including lein-eclipse-1.0.0.jar
Created lein-eclipse-1.0.0.jar

Run lein eclipse to create the files eclipse needs:

$ lein eclipse
Copying 15 files to /Users/philippotter/src/mobile/jquery-mobile-experiment/lib
Created .classpath
Created .project

Then, in eclipse, do “File->Import->Existing Project into Workspace”. You should now have your project imported.