The idea error is: java: error: release version 5 is not supported

When the JDK version of your idea project is too low, an error will be reported as:

Error: Release version 5 is not supported Language level is invalid or missing in pom.xml. Current project JDK is 18. Specify language level insql-father-backend (project name)

This error is often reported when doing maven projects: java: error: release version 5 is not supported. Because the JDK version used by default in the Java compiler in the project is too low .

Method 1: This method is not very good, because once the pom.xml file is modified later, the settings here may be automatically set to 1.5 again.

  1. First open the Settings in File
    insert image description here
  2. Then select File | Settings | Build, Execution, Java Compiler of Compiler in Deployment
    insert image description here
  3. Choose a high-point version at will, click OK, and you can solve
    insert image description here
    Solution 2 : Specify the version of maven-compiler-plugin in pom.xml. This version will affect LanguageLevel and JavaCompiler at the same time. After modification, Maven will use the one set here by default. version up.
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>4.0</version>
            <configuration>
                <!--根据个人需要自己修改-->
                <source>9</source>
                <target>9</target>
            </configuration>
        </plugin>
    </plugins>
</build>

Guess you like

Origin blog.csdn.net/ex_6450/article/details/127648215