ProGuard says Unsupported class version number [52.0] (maximum 51.0, Java 1.7) with sbt-proguard

流过昼夜 提交于 2019-11-28 10:45:09

It appears that ProGuard and hence sbt-proguard don't support Java 8 yet and changing the version of Java used in the script to launch sbt helped.

[sbt-updates]> show proguard:proguard
[info] Compiling 8 Scala sources to /Users/jacek/oss/sbt-updates/target/scala-2.10/sbt-0.13/classes...
[warn] there were 6 feature warning(s); re-run with -feature for details
[warn] one warning found
[info] ProGuard, version 4.9
[info] Reading program directory [/Users/jacek/oss/sbt-updates/target/scala-2.10/sbt-0.13/classes] (filtered)
[info] Reading program jar [/Users/jacek/.ivy2/cache/org.scalaz/scalaz-concurrent_2.10/bundles/scalaz-concurrent_2.10-7.1.0-M6.jar] (filtered)
...

This is with the following version of Java 7:

$ /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

It's possible to update the version of Proguard that sbt-proguard uses by changing the key proguardVersion in build.sbt to a setting newer than 5.0, e.g.

ProguardKeys.proguardVersion in Proguard := "5.2.1"

See: https://github.com/sbt/sbt-proguard/issues/5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!