I should add, I am aware I can bring in a class dynamically with 
Class/forName, and that is what I ended up doing for the Timer class. 
However, this is not always practical, and sometimes is simply not an 
option if aot-compilation is required.

On Saturday, October 12, 2013 2:28:38 AM UTC-4, Zach Oakes wrote:
>
> I recently learned that merely importing a Java class in Clojure causes 
> static initializers to be run. Sometimes, this causes compilation errors, 
> because they are written with the assumption that they will only be run 
> during runtime.
>
> I ran into this just now while trying to make a simple Clojure game with 
> LibGDX. After simply importing its Timer class, I began getting compilation 
> errors. The stack trace shows it is due to a static 
> initializer<https://github.com/libgdx/libgdx/blob/511b557c1a2d23bf8110a05b0ef54cc20b7f958d/gdx/src/com/badlogic/gdx/utils/Timer.java#L32>attempting
>  to instantiate the class!
>
> I also ran into this recently while trying to use RoboVM. My question is, 
> do I have any options? I haven't found many discussions about this here or 
> elsewhere. This surprises me, because it seems like something more people 
> should be running into.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to