0

I recently included some new jars in my project. Proguard starting blowing up due to the module-info.class being a different version than the compiler version I use for my project, but the classes contained in the jar were the correct version.

I'm using java 1.8 (major: 52). The complaint was that the module-info.class was version 53.

I ran into this with a number of jars. Is there a way around this with proguard?

proguard] Reading library jar [/Users/dan.cosio/.m2/repository/org/codehaus/woodstox/stax2-api/4.2/stax2-api-4.2.jar]
 [proguard] Error: Can't read [/Users/dan.cosio/.m2/repository/org/codehaus/woodstox/stax2-api/4.2/stax2-api-4.2.jar] (Can't process class [module-info.class] (Unsupported class version number [53.0] (maximum 52.0, Java 1.8)))
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Daniel Cosio
  • 177
  • 1
  • 2
  • 16
  • Does this answer your question? [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – Progman Aug 14 '20 at 18:26
  • no.. I understand the versions.. What I don't understand is why jar file built using modules has a module-info.class with a different version that the containing classes. My jre and the containing classes are the same version, but the module-info.class is a newer version and proguard is complaining about that.. – Daniel Cosio Aug 14 '20 at 19:01
  • @DanielCosio The `module-info.class` can only be generated by Java 9, and requires a minimum class version of 53 (because modules don't exist in Java 8 and earlier), if ProGuard only understands class version 52, then obviously it cannot read module-info.class. – Mark Rotteveel Aug 16 '20 at 08:02

1 Answers1

2

I excluded the module-info.class from proguard so I can continue. I added

<inLibFilter>!module-info.class</inLibFilter>

to my configuration.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Daniel Cosio
  • 177
  • 1
  • 2
  • 16