Fork me on GitHub
#clojure-uk
<
2024-07-10
>
schmalz07:07:54

Morning all.

dharrigan14:07:16

How can I check if a java class (or interface) is on the classpath in Clojure?

dharrigan15:07:59

(my goal is to only require some classes, and make them available in the namespace, if and only if the class exists on the classpath)

seancorfield15:07:53

Class.forName() perhaps?

seancorfield15:07:00

(it'll throw if the class isn't loadable)

dharrigan19:07:25

Ah, good ol'interop - shall try that 🙂