Advertisement
Guest User

Untitled

a guest
Dec 7th, 2011
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn classpath-add [path]
  2.   (let [url (cond (string? path) (.toURL (new File path))
  3.                   (instance? File path) (.toURL path)
  4.                   :else path)
  5.         addURL (.getDeclaredMethod (identity java.net.URLClassLoader)
  6.                                    "addURL"
  7.                                    (into-array [java.net.URL]))]
  8.     (.setAccessible addURL true) ; scared yet?
  9.     (.invoke addURL (ClassLoader/getSystemClassLoader) (to-array [url]))))
  10.  
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement