#Error java 17 when launch in terminal mvn spring-boot:run

10 messages · Page 1 of 1 (latest)

wheat comet
#

My basic configuration doesn't seem to work

Here the error message

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project anomymous_name: Fatal error compiling: error: release version 17 not supported -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

mvn -version

Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f)
Maven home: C:\Users\sheri\Documents\apache-maven-3.9.3
Java version: 11.0.3, vendor: Amazon.com Inc., runtime: C:\Program Files\Amazon Corretto\jdk11.0.3_7
Default locale: fr_BE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"```
cunning wingBOT
#

This post has been reserved for your question.

Hey @wheat comet! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

wheat comet
#

pom.xml

<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.1.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.anomymous</groupId>
    <artifactId>anomymous_name</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>anomymous_name</name>
    <description>anomymous description</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

</project>
zenith talon
#

release version 17 not supported

<java.version>17</java.version>

wheat comet
#

Yes I have understand it, but why is it possible to create a spring project with java 17 ?

zenith talon
#

Because Spring supports Java 17. I don't know what exactly causes a problem here, but my guess is that you're limited by the version of your Java runtime.

wheat comet
#

Okay, what do you think I can do to bypass this problem, change java version for example ?

Any idea of a stable java version ?

zenith talon
#

Install JDK 17 shrugging

#

17 is stable. 21 will be stable the next month, when it will be released.