我正尝试按照本教程为 Android 编译 Clojure:https://github.com/clojure-android/lein-droid/wiki/Tutorial
但是,我正在打一个
unsupported class file version 52.0
错误。
这似乎是因为我有 Java 1.8,但我的代码需要与 Android 项目的 1.7 兼容。
Got "unsupported class file version 52.0" after including a module to a project似乎建议我可以设置 sourceCompatibility 和 targetCompatibility(在 gradle 构建文件中。)
大概在 Leiningen project.clj 文件中有一个等效项。但我找不到它是什么。
那么如何在 Leiningen 中设置源和目标兼容性?
最佳答案
好的。我设法用这里的信息解决了我的问题:
https://github.com/clojure-android/lein-droid/issues/161?_pjax=%23js-repo-pjax-container
基本上是 javac-options 属性。
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
但我也需要更新 annotations.jar(如该 GitHub 页面所述)。
关于java - 在 Leiningen (Clojure) for Android 中设置 JavaVersion sourceCompatibility(Java 1.7 vs 1.8),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46624230/