views:

68

answers:

1

I need to use my clojure functions with slime-connect. And I put all my libs in the $CLASSPATH.

As I learned from this question. I used the following command to check the CLASSPATH for current environment, and I found none of my $CLASSPATH is used.

How can I attach my class path for my clojure with emacs/slime-connect? I installed my emacs/leinigen as asked and answered here.

(doseq [p (.getURLs (java.lang.ClassLoader/getSystemClassLoader))] (println (.getPath p)))
/Users/smcho/bin/leiningen/src/
/Users/smcho/bin/leiningen/test/
/Users/smcho/bin/leiningen/classes/
...
/Users/smcho/bin/leiningen/lib/dev/swank-clojure-1.2.1.jar
+3  A: 

lein provides that libraries, that are specified in its dependencies. So, it's better to specify all needed libraries in project.clj, and re-run lein swank command

Alex Ott
@Alex : Thanks for the answer, but I can't see how to add classpath to project.clj. Could you give me more hints?
prosseek
If you have libraries, that aren't exist in existing repositories, then you can simply copy these libraries into lib directory, they will seen by leiningen. If libraries are exist in repositories, then you can specify their names and they will fetched automatically. You can use my article about lein (http://alexott.net/en/clojure/ClojureLein.html) as short introduction into work with this tool
Alex Ott
@Alex : I just copied the libs to the leiningen/lib, and it works fine. Thanks.
prosseek