运行springboot新建的项目,运行Application类时报错
跟着视频,创建了Application和application.yml文件,foodie项目install之后,运行application类直接报错,jdk的版本是1.8,找不到原因。
[2022-07-05 19:53:04.734] - 2910 信息 [main] --- com.syy.Application: Starting Application on LPT008660 with PID 2910 (/Users/shuyangyang/workspaces/codes/back-end/foodie-dev/target/classes started by shuyangyang in /Users/shuyangyang/workspaces/codes/back-end/foodie-dev)
[2022-07-05 19:53:04.752] - 2910 信息 [main] --- com.syy.Application: No active profile set, falling back to default profiles: default
[2022-07-05 19:53:04.802] - 2910 警告 [main] --- org.springframework.context.annotation.AnnotationConfigApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/shuyangyang/workspaces/codes/back-end/foodie-dev/target/classes/com/syy/Application.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 [/Users/shuyangyang/workspaces/codes/back-end/foodie-dev/target/classes/com/syy/Application.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 62
[2022-07-05 19:53:04.812] - 2910 严重 [main] --- org.springframework.boot.SpringApplication: Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/shuyangyang/workspaces/codes/back-end/foodie-dev/target/classes/com/syy/Application.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 [/Users/shuyangyang/workspaces/codes/back-end/foodie-dev/target/classes/com/syy/Application.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 62
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:454)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:316)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:275)
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:287)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.syy.Application.main(Application.java:10)
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 [/Users/shuyangyang/workspaces/codes/back-end/foodie-dev/target/classes/com/syy/Application.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 62
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:57)
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:430)
... 19 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 62
at org.springframework.asm.ClassReader.<init>(ClassReader.java:184)
at org.springframework.asm.ClassReader.<init>(ClassReader.java:166)
at org.springframework.asm.ClassReader.<init>(ClassReader.java:152)
at org.springframework.asm.ClassReader.<init>(ClassReader.java:273)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:54)
... 22 more
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星