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?
相关问题
- Eclipse and Mylyn : how to disable grey files in t
- Better Sequence Duplicate Remover
- Step by step instructions for getting cppunit up a
- org.jdesktop.application package doesn't exist
- Installing Pydev for Eclipse throws error
相关文章
- selenium+eclipse 打开网页时报错
- In IntelliJ IDEA, how can I create a key binding t
- IntelliJ IDEA can't open projects or add SDK o
- Eclipse failing to open
- Eclipse how can I indent C++ preprocessor macros
- Why is FindBugs ignoring my check for null?
- Eclipse cleanup - what are the “.index” files - ca
- Eclipse plugin to find out unused methods in a cla
I've been using Intellij IDEA + La Clojure.
lein pom
to create apom.xml
file for Maven.When you change the dependencies with Leiningen, update the
pom.xml
.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.
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.
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.
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.
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 ;)