Hi Daniel,

add-classpath should only be used to add a clojure library on the fly
within a repl session. If you encounter any problems with your code
using add-classpath, you should use the normal way of adding it to
jvm's startup classpath instead. (The reason is that add-classpath
works only for the clojure classloader.)
I'm not sure whether clojure can handle non package qualified java
classes too.

>   user=> (add-classpath "file:///home/me/")
>   nil
>   user=> (. Class (forName "JavaStuff"))
>   JavaStuff
>   user=> (def JavaStuff-class (. Class (forName "JavaStuff")))
>   java.lang.ClassNotFoundException: JavaStuff (NO_SOURCE_FILE:3)
>   user=>

Tried it, and had the same results. Somehow defining a class object as
a root value triggers some mechanism to load it with the root
classloader instead of the clojure one.
However, putting /home/me on the classpath using -cp works.

erik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to