Remember that Clojure, after all, is just Java. That way you can just put the Clojure jar in your classpath and use its classes.
For example, Clojure vectors are instances of clojure.lang.PersistentVector , maps are instances of clojure.lang.PersistentArrayMap and lists, instances of clojure.lang.PersistentList .
I have not tried this in anger myself, but it is probably the line I would take if I wanted to use persistent data structures in Java.
Something like this might start you up:
import clojure.lang.PersistentVector; ... ArrayList list = ... PersistentVector myVector = PersistentVector.create(list); // from here on, using myVector takes advantages of its persistent nature.
Obviously, these classes were built using the Clojure API, and not ease of use with Java - but this is certainly possible.
source share