unsupported minor major jasperreports sbt proguard java-8

sbt - jasperreports - unsupported major minor version 52.0 eclipse



ProGuard dice Número de versión de clase no compatible[52.0](máximo 51.0, Java 1.7) con sbt-proguard (2)

Estoy en Mac OS X 10.9.2 y sbt 0.13.3-SNAPSHOT (construido a partir de las fuentes), Java 8 y el plugin sbt-proguard 0.2.2 .

sbt 0.13.3-SNAPSHOT

[jacek]> sbtVersion [info] 0.13.3-SNAPSHOT

Java 8

$ /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -version java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

project / plugins.sbt

addSbtPlugin("com.typesafe.sbt" % "sbt-proguard" % "0.2.2")

Cuando corrí proguard:proguard en sbt shell estalló con la siguiente excepción:

[sbt-updates]> show proguard:proguard [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) [info] Reading program jar [/Users/jacek/.sbt/boot/scala-2.10.3/lib/scala-library.jar] (filtered) [info] Reading program jar [/Users/jacek/.ivy2/cache/org.scalaz/scalaz-core_2.10/bundles/scalaz-core_2.10-7.1.0-M6.jar] (filtered) [info] Reading program jar [/Users/jacek/.ivy2/cache/org.scalaz/scalaz-effect_2.10/bundles/scalaz-effect_2.10-7.1.0-M6.jar] (filtered) [info] Reading library jar [/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar] [error] Error: Can''t read [/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar] (Can''t process class [apple/applescript/AppleScriptEngine.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) [trace] Stack trace suppressed: run last proguard:proguard for the full output. [error] (proguard:proguard) Proguard failed with exit code [1] [error] Total time: 16 s, completed Apr 19, 2014 2:27:56 PM

¿Por qué podría ser la razón del error?


Parece que ProGuard y, por sbt-proguard tanto, sbt-proguard aún no son compatibles con Java 8, y cambiar la versión de Java utilizada en el script para iniciar sbt ayudó.

[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) ...

Esto es con la siguiente versión de 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)


Es posible actualizar la versión de Proguard que usa sbt-proguard cambiando la clave proguardVersion en build.sbt a una configuración más nueva que la 5.0, por ejemplo

ProguardKeys.proguardVersion in Proguard := "5.2.1"

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