Clojure in intellij

Hi,
Having trouble using clojure contrib in intellij. When I 'require' them in Intellij it says it cannot find them. I have added the jars the module dependencies. And they appear in my external libraries. See attachments. Any help appreciated.



mikext libr.jpge.dependencies.jpg

5 comments
Comment actions Permalink

Having trouble clojure contrib in intellij. I have added the jars the module dependencies. And they appear in my external libraries. See attachments. Any help appreciated.


Surely it would help to describe your troubles in more details.

0
Comment actions Permalink

I simply create a new clojure file and as the first line put:
(require 'clojure.contrib.rep-utils)
And I get the following error message. I thought by putting the files in the dependencies folder (as per previous message) that IntelliJ would be able to find clojure -contrib.
cheers,
mike


ProgrProjects/IdeaProjects/clojure-games/src/snake/halloway/snake.clj
Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/contrib/rep_utils__init.class or clojure/contrib/rep_utils.clj on classpath:  (snake.clj:0)
    at clojure.lang.Compiler.eval(Compiler.java:5341)
    at clojure.lang.Compiler.load(Compiler.java:5736)
    at clojure.lang.Compiler.loadFile(Compiler.java:5699)
    at clojure.main$load_script__6268.invoke(main.clj:213)
    at clojure.main$script_opt__6296.invoke(main.clj:265)
    at clojure.main$main__6314.doInvoke(main.clj:346)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at clojure.lang.Var.invoke(Var.java:365)
    at clojure.lang.AFn.applyToHelper(AFn.java:165)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: Could not locate clojure/contrib/rep_utils__init.class or clojure/contrib/rep_utils.clj on classpath:
    at clojure.lang.RT.load(RT.java:392)
    at clojure.lang.RT.load(RT.java:361)
    at clojure.core$load__5136$fn__5143.invoke(core.clj:4338)
    at clojure.core$load__5136.doInvoke(core.clj:4337)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at clojure.core$load_one__5077.invoke(core.clj:4166)
    at clojure.core$load_lib__5092.doInvoke(core.clj:4203)
    at clojure.lang.RestFn.applyTo(RestFn.java:143)
    at clojure.core$apply__3661.invoke(core.clj:480)
    at clojure.core$load_libs__5108.doInvoke(core.clj:4237)
    at clojure.lang.RestFn.applyTo(RestFn.java:138)
    at clojure.core$apply__3661.invoke(core.clj:480)
    at clojure.core$require__5130.doInvoke(core.clj:4305)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at user$eval__1.invoke(snake.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:5325)
    ... 10 more

Process finished with exit code 1

0
Comment actions Permalink

Hello Mike,

The behavior shown on your screenshots is correct and expected behavior of
IntelliJ IDEA. Why do you think it's a problem?

Having trouble clojure contrib in intellij. I have added the jars the
module dependencies. And they appear in my external libraries. See
attachments. Any help appreciated.
mik Image:ext libr.jpg e. Image:dependencies.jpg


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Really?  I would have thought since the libraries when listed as dependencies of the module they would be on the classpath for that module, and La Clojure -should- resolve them.  At least it does for my Clojure/Maven projects when I import the pom.xml.

Havn't tried a manually setup project for awhile tho..

0
Comment actions Permalink

Sorry, my mistake. Its 'repl-utils' not 'rep-utils'. However, I now get the following exception which I think is related to using clojure-contrib1.1 rather than clojure-contrib1.0.
Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V (snake.clj:0)
    at clojure.lang.Compiler.eval(Compiler.java:5341)
    at clojure.lang.Compiler.load(Compiler.java:5736)
    at clojure.lang.Compiler.loadFile(Compiler.java:5699)
    at clojure.main$load_script__6268.invoke(main.clj:213)
    at clojure.main$script_opt__6296.invoke(main.clj:265)
    at clojure.main$main__6314.doInvoke(main.clj:346)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at clojure.lang.Var.invoke(Var.java:365)
    at clojure.lang.AFn.applyToHelper(AFn.java:165)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V
    at clojure.contrib.seq_utils$rec_seq__724.<init>(seq_utils.clj:99)
    at clojure.contrib.seq_utils__init.load(Unknown Source)
    at clojure.contrib.seq_utils__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1550)
    at clojure.lang.RT.load(RT.java:379)
    at clojure.lang.RT.load(RT.java:361)
    at clojure.core$load__5136$fn__5143.invoke(core.clj:4338)
    at clojure.core$load__5136.doInvoke(core.clj:4337)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at clojure.core$load_one__5077.invoke(core.clj:4166)
    at clojure.core$load_lib__5092.doInvoke(core.clj:4203)
    at clojure.lang.RestFn.applyTo(RestFn.java:143)
    at clojure.core$apply__3661.invoke(core.clj:480)
    at clojure.core$load_libs__5108.doInvoke(core.clj:4237)
    at clojure.lang.RestFn.applyTo(RestFn.java:138)
    at clojure.core$apply__3661.invoke(core.clj:482)
    at clojure.core$use__5132.doInvoke(core.clj:4315)
    at clojure.lang.RestFn.invoke(RestFn.java:437)
    at clojure.contrib.repl_utils$loading__6309__auto____2966.invoke(repl_utils.clj:11)
    at clojure.contrib.repl_utils__init.load(Unknown Source)
    at clojure.contrib.repl_utils__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1550)
    at clojure.lang.RT.load(RT.java:379)
    at clojure.lang.RT.load(RT.java:361)
    at clojure.core$load__5136$fn__5143.invoke(core.clj:4338)
    at clojure.core$load__5136.doInvoke(core.clj:4337)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at clojure.core$load_one__5077.invoke(core.clj:4166)
    at clojure.core$load_lib__5092.doInvoke(core.clj:4203)
    at clojure.lang.RestFn.applyTo(RestFn.java:143)
    at clojure.core$apply__3661.invoke(core.clj:480)
    at clojure.core$load_libs__5108.doInvoke(core.clj:4237)
    at clojure.lang.RestFn.applyTo(RestFn.java:138)
    at clojure.core$apply__3661.invoke(core.clj:482)
    at clojure.core$use__5132.doInvoke(core.clj:4315)
    at clojure.lang.RestFn.invoke(RestFn.java:409)
    at user$eval__1.invoke(snake.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:5325)
    ... 10 more

0

Please sign in to leave a comment.