Java UnsupportedClassVersionError: xxx has been compiled by a more recent version问题解决

问题描述:

        java.lang.UnsupportedClassVersionError: com/demo1/Demo1Application has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

问题分析:

1、JDK运行版本为1.8,但是项目配置的JDK版本为11。

解决办法:

第一步,将项目的Project SDK设为1.8,Project language level设为8。

第二步,将模块的Language level设为8。

2、spring-boot-maven-plugin插件版本太高,导致不支持当前jdk版本。

问题分析:

手动指定spring-boot-maven-plugin插件版本即可。

            <plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>2.1.5.RELEASE</version>
			</plugin>

旭东怪的个人空间-旭东怪个人主页-哔哩哔哩视频哔哩哔哩旭东怪的个人空间,提供旭东怪分享的视频、音频、文章、动态、收藏等内容,关注旭东怪账号,第一时间了解UP注动态。人生低谷不可怕,可怕的是坚持不到人生转折点的那一天https://space.bilibili.com/484264966?spm_id_from=333.337.search-card.all.click


版权声明:本文为qq_38974638原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。