Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\Users\86156\Desktop\ceph\target\classes\com\itcast\ceph\startup\CephDemoApplication.class]; nested exception is 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:\Users\86156\Desktop\ceph\target\classes\com\itcast\ceph\startup\CephDemoApplication.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 62 2023-05-22 22:45:54.061 ERROR 18488 --- [ main] o.s.boot.SpringApplication : Application run failed
时间: 2023-07-21 19:02:52 浏览: 220
Android Caused by: java.lang.ClassNotFoundException解决办法
这个错误提示是因为你的项目中使用了不支持的 Java 版本。错误信息中指出了不支持的类文件主要版本号为 62,这对应的是 Java 18。你需要检查你的项目中是否使用了 Java 18,如果是的话,可以将其降级为支持的 Java 版本,比如 Java 17 或更低版本。或者你也可以升级你的 Spring Boot 版本,以支持 Java 18。
阅读全文