我正在尝试在我的clojure项目中使用instaparse库。我的项目依赖项中使用了leiningen 2.0和clojure 1.5.1。我按照以下方式将instaparse添加到我的项目依赖项中:
(defproject bachelor "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojure-contrib "1.2.0"]
[instaparse "1.1.0"]])
这是我尝试要求该库的源代码:
(ns bachelor.data
(:require [clojure.string :as str])
(:require [instaparse.core :as insta])
(:use [clojure.contrib.generic.math-functions])
)
当我尝试编译时,我得到以下错误信息:
cd c:/bachelor/src/bachelor.data/ 1 compiler notes: Unknown location: error: java.io.FileNotFoundException: Could not locate instaparse/core__init.class or instaparse/core.clj on classpath: company.clj:1:1: error: java.io.FileNotFoundException: Could not locate instaparse/core__init.class or instaparse/core.clj on classpath: (company.clj:1) Compilation failed.
我检查了项目的类路径,我认为instaparse应该被找到。 lein classpath C:\bachelor\test;C:\bachelor\src;C:\bachelor\dev-resources;C:\bachelor\resources;C:\bachelor\target\classes;C:\Users\Maciej.m2\repository\instaparse\instaparse\1.1.0\instaparse-1.1.0.jar;C:\Users\Maciej.m2\repository\org\clojure\clojure-contrib\1.2.0\clojure-contrib-1.2.0.jar;C:\Users\Maciej.m2\repository\org\clojure\clojure\1.5.1\clojure-1.5.1.jar 你有任何想法我做错了什么吗?
更新:
我更新了lein classpath的结果。之前,我粘贴了旧的结果。