Reputation: 27186
I'm trying to get Clojure compiling for Android following this tutorial : https://github.com/clojure-android/lein-droid/wiki/Tutorial
However, I'm hitting an
unsupported class file version 52.0
error.
This seems to be because I have Java 1.8, but my code needs to be compatible with 1.7 for Android projects.
Got "unsupported class file version 52.0" after including a module to a project seems to suggest I can just set the sourceCompatibility and targetCompatibility (there in the gradle build file.)
Presumably there's an equivalent in Leiningen project.clj files. But I can't find what it is.
So how can I set source and target Compatibility in Leiningen?
Upvotes: 1
Views: 274
Reputation: 27186
OK. I managed to resolve my problem with information from here :
https://github.com/clojure-android/lein-droid/issues/161?_pjax=%23js-repo-pjax-container
Basically it's the javac-options attribute.
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
But I needed to update the annotations.jar (as described on that GitHub page) too.
Upvotes: 1