简体   繁体   English

pom.xml 中的语言级别无效或缺失。 当前项目JDK为11,在项目中指定语言级别

[英]Language level is invalid or missing in pom.xml. Current project JDK is 11. Specify language level in project

I am generate the following project and its dependencies with Spring Boot 3 from Spring initializr我使用 Spring initializr 中的 Spring Boot 3 生成以下项目及其依赖项

弹簧初始化器

Opening and running project in Intellij IDEA the following output is returned在Intellij IDEA中打开并运行项目返回如下output

error: release version 17 not supported

Language level is invalid or missing in pom.xml. Current project JDK is 11. Specify language level in webflux-project 

I have jdk 11 installed on my system我的系统上安装了 jdk 11

> java --version
java 11.0.14 2022-01-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.14+8-LTS-263)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.14+8-LTS-263, mixed mode)

pom.xml: pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.1</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.gamesmall</groupId>
    <artifactId>webflux</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>webflux</name>
    <description>Demo project for Spring Boot with WebFlux</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        ...
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

how to resolved this issue?如何解决这个问题?

According tothis article Spring Boot 3.0 will require Java 17 (jdk 17).根据这篇文章Spring Boot 3.0 将需要 Java 17 (jdk 17)。 So during project generation change Spring Boot version from 3.* to 2.7.* and solved !所以在项目生成期间将 Spring 引导版本从 3.* 更改为 2.7.* 并解决了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每次重新加载 pom 时停止 IntelliJ IDEA 切换 java 语言级别(或更改默认项目语言级别) - stop IntelliJ IDEA to switch java language level every time the pom is reloaded (or change the default project language level) 不同的项目 SDK 和语言级别 - Different Project SDK and Language Level 项目语言级别为8的Project sdk 1.7 - Project sdk 1.7 with Project language level 8 IntelliJ IDEA中的项目语言级别是什么? - What is Project Language level in IntelliJ IDEA? 无法解决IntelliJ上与项目语言级别有关的源错误 - Can't resolve -source errors on IntelliJ with regards to Project Language Level 如何在 Android Studio 上更改项目语言级别 - How do I change Project language level on Android Studio 在现代项目中使用具有较旧语言级别的JAR会对性能产生什么影响? - What are the performance implications of using a JAR with an older language level in a modern project?` intellij:项目级 jdk 未被 sbt 占用 - intellij:project level jdk not taken up by sbt 在 java 项目的 pom.xml 中,我缺少工件 jdk.tools:jdk.tools:jar:1.6 错误 - In the pom.xml for a java project, I get missing artifact jdk.tools:jdk.tools:jar:1.6 error 更新到gradle 5.1.1并将项目更改为java 11后无法构建项目。无效的类型代码 - Can't build project after updating to gradle 5.1.1 and project to java 11. Invalid type code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM