【异常】jdk21升级,asm报错Unsupported class file major version 65 springboot2 升级JDK21

【异常】jdk21升级,asm报错Unsupported class file major version 65

错误信息

Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [C:\App.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 65
	at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:60)
	at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:49)
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)
	at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:123)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:429)
	... 20 common frames omitted
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65
	at org.springframework.asm.ClassReader.(ClassReader.java:199)
	at org.springframework.asm.ClassReader.(ClassReader.java:180)
	at org.springframework.asm.ClassReader.(ClassReader.java:166)
	at org.springframework.asm.ClassReader.(ClassReader.java:287)
	at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:57)
	... 24 common frames omitted

排查 发现是这个类导致的

org.springframework.asm.ClassReader

在代码里写死了限制jdk版本

【异常】jdk21升级,asm报错Unsupported class file major version 65 springboot2 升级JDK21_第1张图片

直接重写该类

【异常】jdk21升级,asm报错Unsupported class file major version 65 springboot2 升级JDK21_第2张图片

把这四行注释掉 

【异常】jdk21升级,asm报错Unsupported class file major version 65 springboot2 升级JDK21_第3张图片

问题解决

或者  升级

升级spring-core版本,整体springboot升级

你可能感兴趣的:(问题异常,python,开发语言)