I setup emacs slime/clojure as written here.
When I run (doseq [p (.getURLs (java.lang.ClassLoader/getSystemClassLoader))] (println (.getPath p))) to get classpath, I get the following.
/Users/smcho/.swank-clojure/clojure-1.1.0-master-20091202.150145-1.jar /Users/smcho/.swank-clojure/clojure-contrib-1.1.0-master-20091212.205045-1.jar /Users/smcho/.swank-clojure/swank-clojure-1.1.0.jar
How can I add classpath for emacs/slime for clojure?
The procedure differs depending on whether you are using
slime-connectto start slime (by connect to a remote swank server, created withlein swank, for example) or you are starting slime usingM-X slime.If you’re using
slime-connect, you’ll need to modify the classpath of the java process that is running the swank server. If you’re starting the swank server usinglein swank, simply add the jars you want to be part of your classpath to the project’slibdirectory.On the other hand, if you’re starting slime using
M-X slime, the following elisp code will do the magic for you (just place it in your ~/.emacs file).This will add
/Users/smcho/.clojure/and/Users/smcho/.clojure/blah.jarto the classpath. (Please note that you’ll either need to restart emacs or reload the .emacs file: typeM-X load-libraryand then type.emacson the next prompt.)