How do I call a non-public method of a public class in Clojure?

Posted by sramsay on Stack Overflow See other posts from Stack Overflow or by sramsay
Published on 2010-03-23T14:46:06Z Indexed on 2010/03/23 22:53 UTC
Read the original article Hit count: 164

Filed under:

I'm calling the twitter4j library using Clojure like so:

(def twitter (. (TwitterFactory.) getInstance))

This works fine when I call it as a script. But when I use gen-class, I get:

java.lang.IllegalArgumentException: Can't call public method of non-public class: public java.lang.Object twitter4j.TwitterFactoryBase.getInstance()

Is there a workaround for this?

© Stack Overflow or respective owner

Related posts about clojure