Unsupported major.minor version 52.0

143 篇文章 ¥9.90 ¥99.00
当遇到'Unsupported major.minor version 52.0'错误时,通常是由于运行环境的JDK版本低于编译时的版本。错误中的52.0对应于JDK 1.8。解决方法包括检查并确保Linux系统、Eclipse项目、pom.xml文件中的JDK版本一致性,以及调整Eclipse的Java编译器和JRE设置至兼容版本。

https://blog.youkuaiyun.com/earthchinagl/article/details/79759138

简单来说,就是执行代码的jdk版本 低于 编译的jdk版本


最后面的52.0是一种叫什么魔码,有各自对应的jdk版本。

其中52.0 对应的就是 jdk1.8版本。


我说一下我碰到错误的场景:

背景:在Eclipse中将maven项目打成jar包,然后放在linux系统上,通过java -jar 的命令运行该jar包。

运行的时候报错:Unsupported major.minor version 52.0

检查一:检查linux系统安装的jdk版本

检查linux系统的jdk版本是1.7,即运行环境的jdk版本 与 我放在linux系统上的编译的jdk版本不一致。

检查二:检查本地Eclispe中项目中的jdk版本,如图:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\BJJGSWGLJ\hd\wisdom-city-common\target\classes\com\louddt\asset\wisdom\entity\common\dict\Dict.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 [E:\BJJGSWGLJ\hd\wisdom-city-common\target\classes\com\louddt\asset\wisdom\entity\common\dict\Dict.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 61 at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:452) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:315) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:276) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationCl
最新发布
08-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hello_world!

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值