Setting the Classpath and Accessing code from book: Programming Clojure
- by user130153
(I posted this same question on the Clojure list but haven't got an answer yet. Is anyone here ready to help?)
I am going through Programming Clojure and I recently downloaded the code from the books official website. For other utils I can do, for example, (require 'clojure.contrib.str-utils) and it works. But how do I load code from the book? (require 'examples.introduction) throws the following exception:
java.io.FileNotFoundException: Could not locate examples/ introduction__init.class or examples/introduction.clj on classpath:
(NO_SOURCE_FILE:0)
[Thrown class clojure.lang.Compiler$CompilerException]
Here is the full backtrace:
Backtrace:
0: clojure.lang.Compiler.eval(Compiler.java:4543)
1: clojure.core$eval__3990.invoke(core.clj:1728)
2: swank.commands.basic$eval_region__686.invoke(basic.clj:36)
3: swank.commands.basic$listener_eval__695.invoke(basic.clj:50)
4: clojure.lang.Var.invoke(Var.java:346)
5: user$eval__1200.invoke(NO_SOURCE_FILE)
6: clojure.lang.Compiler.eval(Compiler.java:4532)
7: clojure.core$eval__3990.invoke(core.clj:1728)
8: swank.core$eval_in_emacs_package__307.invoke(core.clj:55)
9: swank.core$eval_for_emacs__384.invoke(core.clj:123)
10: clojure.lang.Var.invoke(Var.java:354)
11: clojure.lang.AFn.applyToHelper(AFn.java:179)
12: clojure.lang.Var.applyTo(Var.java:463)
13: clojure.core$apply__3243.doInvoke(core.clj:390)
14: clojure.lang.RestFn.invoke(RestFn.java:428)
15: swank.core$eval_from_control__310.invoke(core.clj:62)
16: swank.core$eval_loop__313.invoke(core.clj:67)
17: swank.core$spawn_repl_thread__445$fn__476$fn__478.invoke(core.clj:
173)
18: clojure.lang.AFn.applyToHelper(AFn.java:171)
19: clojure.lang.AFn.applyTo(AFn.java:164)
20: clojure.core$apply__3243.doInvoke(core.clj:390)
21: clojure.lang.RestFn.invoke(RestFn.java:428)
22: swank.core$spawn_repl_thread__445$fn__476.doInvoke(core.clj:170)
23: clojure.lang.RestFn.invoke(RestFn.java:402)
24: clojure.lang.AFn.run(AFn.java:37)
25: java.lang.Thread.run(Unknown Source)
I am trying both Clojure Box and Enclojure in NetBeans on Windows XP.
Is it a classpath issue? Where should I place the folder that contains code from the book? Please help me out with my variable enviroment settings as well.