且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Eclipse:Tomcat: 无法读取候选组件类:

更新时间:2023-01-12 17:11:50

ASM ClassReader 无法解析类文件 - 可能是由于尚不支持新的 Java 类文件版本":你的问题属于这个问题的范畴,但我相信它与它略有不同.

"ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet": your problem falls into the category of this question, but I believe it slightly differs from it.

Spring 附带了重新打包的 ASM 版本,在 5.1.x 系列中,该版本仅支持最多 12 个 Java.切换到 5.2.x 系列以支持 Java 13.

Spring comes with a repackaged version of ASM, that in the 5.1.x series supports only Java up to 12. Switch to the 5.2.x series for Java 13 support.

由于您的项目是新项目(没有兼容性问题),我将使用最新发布的 Spring 版本(撰写本文时为 5.3.4).

Since your project is new (no compatibility issues) I would use the newest Spring version released (5.3.4 at the time of writing).

编辑:Spring 重新打包的 ASM 支持的 Java 版本的小总结:

Edit: A small summary of the Java versions supported by Spring's repackaged ASM:

  • Spring 5.0.x:版本检查已注释掉(参见 源代码),
  • Spring 5.1.x:最高可达 Java 12,
  • Spring 5.2.x:最高可达 Java 15,
  • Spring 5.3.x:适用于 Java 18.