Java 模块版本不匹配。

huangapple go评论55阅读模式
英文:

java modules version mismatch

问题

我最近在我的项目中添加了一些新的JAR包。由于module-info.class的版本与我项目中使用的编译器版本不同,Proguard开始出现问题,但是JAR包中包含的类是正确的版本。

我正在使用java 1.8(主要版本:52)。抱怨说module-info.class的版本是53。

我在许多JAR包中都遇到了这个问题。在使用Proguard时是否有解决方法?

proguard] 读取库jar [/Users/dan.cosio/.m2/repository/org/codehaus/woodstox/stax2-api/4.2/stax2-api-4.2.jar]
 [proguard] 错误: 无法读取 [/Users/dan.cosio/.m2/repository/org/codehaus/woodstox/stax2-api/4.2/stax2-api-4.2.jar](无法处理类 [module-info.class](不支持的类版本号 [53.0](最大为52.0,Java 1.8)))
英文:

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

答案1

得分: 2

把 module-info.class 从 proguard 中排除,这样我就可以继续了。
我添加了

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

到我的配置中。

英文:

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

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

to my configuration.

huangapple
  • 本文由 发表于 2020年8月15日 02:06:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/63417945.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定