clojure Java interop Calling a Clojure function from Java


Example

You can call a Clojure function from Java code by looking up the function and invoking it:

IFn times = Clojure.var("clojure.core", "*");
times.invoke(2, 2);

This looks up the * function from the clojure.core namespace and invokes it with the arguments 2 & 2.