> It's not really a good idea to AOT your code and then directly try to > use it from java. The generated java bytecode isn't guaranteed to be > stable across versions of clojure, and you're depending on > implementation details. > > One way to use your clojure code from java is through RT. An example > would be the accepted answer here: > http://stackoverflow.com/questions/2181774/calling-clojure-from-java > > I really don't like the RT way (very clumsy), so I want to avoid it if possible. My .jar file will include Clojure itself in it, so compatibility with different version of Clojure is not a problem for me. But is there any other pitfalls using AOT?
Another tack you can take is to use gen-class to create a "real" java > class from clojure and use that as an entry point to your clojure > code. > > My understanding is "defrecord" actually generate a real named java class. And I can use it in Eclipse project so it seems that is the case. BTW: my issue is solved by using some kind of annotation defined by the target Java framework. However, I could have been in a dead end if there is no such annotation and the classloader is messed up. So just as someone says "things are never as simple as it seems". -- 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