5
votes

I'm stuck with "Programming Clojure" on page 37 on a Windows 7 machine. After downloading the "examples" dir into "C:/clojure", I typed:

user> (require 'examples.introduction)

and I got

; Evaluation aborted.

java.io.FileNotFoundException: Could not locate examples/ introduction__init.class or examples/introduction.clj on classpath: (NO_SOURCE_FILE:0)

My .emacs file looks like this:

(setq swank-clojure-extra-classpaths (list "C:/Clojure"))

The files in C:/Clojure are there (I triplechecked)

Any help will be appreciated.

2
Just to be sure, can you also check your classpath from the REPL: (System/getProperty "java.class.path")? - Siddhartha Reddy
Can you confirm that clojure is running from the right place? user> (. System getProperty "user.dir") will print the current directory. Check that that comes up as C:/Clojure - MattyW
Thanks for your hints on checking the classpath and the user dir from inside the REPL, guys. Here are the results. The classpath is: "c:/Program Files/Clojure Box/swank-clojure/src;c:/Program Files/Clojure Box/lib/clojure-contrib.jar;c:/Program Files/Clojure Box/lib/clojure.jar" and the user dir is: "c:\\Clojure" Sorry for my (non-)formatting; unfortunately, I don't know how to format source code in my comments yet. - Rainer
I get the error unless I (set! compile-path ".") - mcandre

2 Answers

1
votes

Problem solved! The .emacs file should contain this line - watch out for "classpath" without the "s"):

(setq swank-clojure-classpath
        (list "c:/Clojure"))

Thanks to Shawn Hoover for giving me this answer via email. (And thanks to everybody else for your hints!)

0
votes

Try

(setq swank-clojure-extra-classpaths ("C:/Clojure"))