I'm looking at switching my projects build from Ant to leiningen and wanted to know if there is a Clojure IDE (intellij, eclipse, netbeans) for which the "build" and "debug" buttons will still work?
-
1CounterClockwise (for Eclipse) now has Leiningen integration and generates news projects as Leiningen projects. – Matt Wonlaw Apr 18 '13 at 05:09
6 Answers
I've been using Eclipse and CounterClockwise plugin with Leiningen configured to be accessed via External Tools. As the blog post title says, it's a "Poor Man's Integration", but has worked for the example I've tried.

- 2,200
- 5
- 25
- 44
-
Works like a charm. Your much appreciated tip deserves more upvotes! – Carl Smotricz Sep 29 '11 at 20:03
-
Hi, I tried it out, but unfortunately, running "new" created a complete new project inside the existing project, not just the clj files. Did you encounter this, too? – Hans-Peter Stricker Nov 07 '11 at 11:31
-
FYI: The "Poor Man's Integration" link is dead now that Posterous Spaces have closed shop. – RJHunter May 06 '14 at 10:44
-
Thansk for that, RJHunter - there's this link from the web archive, but no images: https://web.archive.org/web/20130508114845/http://sexp.posterous.com/poor-mans-integrating-leiningen-into-counterc – Alistair Collins May 06 '14 at 16:48
I have had some luck with La Clojure and the "Leiningen" plugin for IntelliJ IDEA. After creating a new project on the command line with lein new
, I created a new project in IntelliJ. The Run Configuration Script Path needs to be pointed to the core.clj file, and the Module Settings "Dependencies" need to include the lib directory as a "Module Library."
The Leiningen plugin offers the usual lein commands, so you can build your jar directly from the IDE (or from the shell). You can edit your project.clj file from IDEA, and the Run and Debug seem to work as well.
BTW, I also found this screencast very helpful for getting started with La Clojure.

- 1,567
- 1
- 10
- 11
-
thanks. you can (now?) open an existing lein project using the "open project" option in the file menu, but i still needed to add the lib directory as you describe. – andrew cooke Apr 16 '12 at 00:38
For debugging, syntax highlighting, and running clojure in Eclipse try:
Download counterclockwise for syntax highlighting via external tools using the update site.
Add
[lein-eclipse "1.0.0"]
to your dependencies in your project.clj file.Add the plugin manually with command:
lein plugin install lein-eclipse "1.0.0"
. This step is included because just adding the dependency doesn’t always work.Run the command
lein eclipse
in project folder to generate eclipse .project and .classpath files. This step might take awhile. If it gets stuck, run it again. It should say "created .project and .classpath".Restart Eclipse.
Go to |File -> Import -> General -> Existing Projects in Workspace| and select the project folder. You should be able to select the clojure project, debug and run it.
Notes: It doesn't seem to add the dev-dependencies to the project classpath. Also, you need to change your workspace to the folder with the project so it does not make a second copy of the project and uses the actual files.

- 48,199
- 22
- 128
- 192

- 195
- 1
- 8
-
1Leiningen says "The plugin task has been removed." when running "lein plugin install lein-eclipse 1.0.0". Any ideas? – user1338062 Mar 16 '13 at 13:12
-
Are you running lein 2.0? If so, you need to use the `:user` profile to specify plugins. This is explained here: https://github.com/technomancy/leiningen/wiki/Upgrading Good point: Step 3 should be done with `:user` profile for lein 2.0 – Colbert Sesanker Mar 17 '13 at 16:38
It's hard to be definitive about this without going through the latest version of every IDE plugin for Clojure, but as someone who keeps up with both Leiningen and the general IDE related developments I have not seen this functionality anywhere. The words IDE, eclipse and netbeans have not been mentioned on the Leiningen google group either, and I would assume that if someone was working on this they would mention it there.
Leiningen is really easy to use on the command-line though, so don't be afraid to give it a try. I've been converting my projects to lein from using both ant and maven previously. The dependency tracking is really handy, and more plugins adding useful new commands are coming out every week. If you really need IDE integration one lightweight way to do it might be to add some kind of custom command command or button that just runs lein in the background.

- 849
- 1
- 7
- 9
The best integration I've found is with slime-clojure via lein-swank.
Basically, you use the lein swank command to start a swank server with a Leiningen-configured classpath. Then, you connect to that swank server using M-x slime-connect, and you've got the repl good to go. Well, so long as you can deal with emacs ;)

- 5,588
- 31
- 48
I've been using Intellij IDEA + La Clojure.
- Run
lein pom
to create apom.xml
file for Maven. - Create a new project in Intellij IDEA and select create from Maven project.
When you change the dependencies with Leiningen, update the pom.xml
.

- 7,503
- 5
- 34
- 52