目录

大橙子

VX:ZzzChChen
Phone:13403656751
Email:zxydczzs@gmail.com

X

Java 启动报错 JspTemplateAvailabilityProvider has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Java 项目启动时提示以下错误,该错误大概意思为项目中被高版本的玩意儿编译了,需要最少 Java17 来启动,但是你现在的版本只有 1.8,所以启动不了,要么是你的 Java 版本不对,要么是你 SpringBoot 版本不对,SpringBoot 3.X 版本以上需要 Java17 来启动,从这两方面下手。

image.png

1. 首先我明确了本身的 Java 版本为 1.8,所以不存在是由于我 Java 版本高导致的,要是我本身就是 17,那么启动应该也不会报错,所以 Java 版本问题排除。
2. 其次开始排查 SpringBoot 版本,代码中全局搜索「spring-boot-starter-parent」,没搜到可能在父 pom 里,多找一下,最后发现版本是正常的。
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
3. 其次查看其他 SpringBoot 组件的版本,最终发现 「spring-boot-starter-web」的版本引入了 RELEASE,而 LATEST 或 RELEASE 这两个特殊关键字已被 Maven 弃用,将 RELEAE 版本改为跟父工程保持一致即可。
	<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
<!--            <version>RELEASE</version>-->
<!--            <scope>compile</scope>-->
            <version>2.3.2.RELEASE</version>
        </dependency>

标题:Java 启动报错 JspTemplateAvailabilityProvider has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
作者:zzzzchen
地址:https://www.dczzs.com/articles/2025/08/05/1754364979313.html