English 中文(简体)
进口香料功能
原标题:Importing clojure functions from jars

我与Clojure周围玩.,我可以说明如何从衣帽子进口一功能。 https://stackoverflow.com/questions/871997/use-vs-require-in-clojure/1020623#1020623” 回答:

保留地类似:

 java -cp clojure.jar:clojure-contrib.jar clojure.main

然后试图进口一项功能:

user=>  (use  [clojure-contrib.duck-streams :only (writer reader)])

它没有工作,我有以下错误:

java.io.FileNot FoundException: 不能将布林盖定位于:

采用警棍而不是ash子,也做不到的工作:

user=>  (use  [clojure.contrib.duck-streams :only (writer reader)])

我的错误大体相同:

java.io.FileNot FoundException: 不能将 clo/cont/duck_streams_init.class 或 clo/contrib/duck_streams.clj 列入班次:(NO_SOURCE_FILE:0)

我做了什么错误?

最佳回答

工作

(use  clojure.contrib)

现在我看不出手套,但现在我看不到。

(use  clojure.contrib :only (writer reader))

工作

问题回答

现行工作名录中是否有<代码>clojure.jar和clojure-contrib.jar? 如果没有,你需要具体说明在CLSPATH查阅JAR档案的全部途径。

它带有衣物,而不是衣着。 注





相关问题
How to improve Clojures error messages

I ve been playing a bit with Clojure and so far is fairly impressed, but one thing that I keep running into is wierd error messages from Clojure. This comes in two forms: Java errors, like null ...

clojure rmi classpath problem

I am trying to use clojure to implement a "plugin" for some vendor supplied software. Here is a little background on the vendor supplied software. It expects me to implement a particular interface ...

Help translating this Java codeblock to Clojure?

I m getting my feet wet with Clojure, and trying to get used to functional programming. I ve been translating various imperative functions from other languages into their Clojure equivalents -- and ...

Is functional Clojure or imperative Groovy more readable?

OK, no cheating now. No, really, take a minute or two and try this out. What does "positions" do? Edit: simplified according to cgrand s suggestion. (defn redux [[current next] flag] [(if flag ...

taking java method names as function arg in clojure

All, I want to create a function that takes a symbol representing a java method and applies it to some object: (user=> (defn f [m] (. "foo" (m))) When I execute this, I get a result much ...

how to efficiently apply a medium-weight function in parallel

I m looking to map a modestly-expensive function onto a large lazy seq in parallel. pmap is great but i m loosing to much to context switching. I think I need to increase the size of the chunk of work ...

热门标签