Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn classpath-add [path]
- (let [url (cond (string? path) (.toURL (new File path))
- (instance? File path) (.toURL path)
- :else path)
- addURL (.getDeclaredMethod (identity java.net.URLClassLoader)
- "addURL"
- (into-array [java.net.URL]))]
- (.setAccessible addURL true) ; scared yet?
- (.invoke addURL (ClassLoader/getSystemClassLoader) (to-array [url]))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement