---
title: "怎么导入clojure项目到eclipse中"
author: "imacej"
date: "2012-12-16T21:53:40Z"
tags: []
categories: ["编程语言"]
slug: "clojure-eclipse"
draft: false
lastmod: "2012-12-16T21:53:39Z"
id: 1748741
url: "https://imacej.iteye.com/blog/1748741"
---

## Clojure: Importing a Leiningen Project into Eclipse

March 10th, 2011 | Posted by [Jay](http://timpner.com/author/jay/ "View all posts by Jay") in [Computing](http://timpner.com/category/computing/ "View all posts in Computing")

To import a Leiningen project into Eclipse, so that you can use CounterClockwise with all its nice features, such as syntax highlighting, there is a handy plugin called **lein-eclipse** .

To get started, all you have to do is to add this plugin as a *dev-dependency* in your project’s `project.clj` .

```
(defproject my-project "1.0.0-SNAPSHOT"
  :description "My Clojure Leiningen Project"
  :dependencies [
        [org.clojure/clojure "1.2.0"]
        [org.clojure/clojure-contrib "1.2.0"]
	[ring/ring-jetty-adapter "0.2.5"]
  ]
  :dev-dependencies [
        [lein-eclipse "1.0.0"]
  ]
)
```

 

Then, you need to download the project dependencies via

**prompt&gt; lein deps**

This will automatically install *lein-eclipse* and add a new task called *eclipse* to *leiningen* . Invoking

**prompt&gt; lein eclipse**

runs this task and creates the Eclipse projects files `.project` and `.classpath` . Now you can simply import the project into Eclipse via “File-&gt;Import-&gt;Existing Project into Workspace”.