在运行一个spring boot的eureka服务模块的启动类时报错:org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\eureka\EurekaApplication.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 [D:\eureka\EurekaApplication.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 61
出现这个错误是因为你的代码中使用了一个不受支持的Java类文件版本。根据错误信息,你的类文件版本是61,而当前使用的Spring版本不支持该版本。
更改语言级别为8解决