;;Check if class c exists on the classpath
(use '[clojure.reflect :only [resolve-class]])
(defn class-exists? [c]
(resolve-class (.getContextClassLoader (Thread/currentThread)) c))
user=> (class-exists? 'org.joda.time.DateTime)
nil
;;Check if class c exists on the classpath
(use '[clojure.reflect :only [resolve-class]])
(defn class-exists? [c]
(resolve-class (.getContextClassLoader (Thread/currentThread)) c))
user=> (class-exists? 'org.joda.time.DateTime)
nil
Comments top
No comments for resolve-class. Log in to add a comment.