无效的标记: --release

报错信息

D:\workspace\jdk1.8.0_321\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\workspace\demo “-Dmaven.home=D:\JetBrains\IntelliJ IDEA 2021.2.1\plugins\maven\lib\maven3” “-Dclassworlds.conf=D:\JetBrains\IntelliJ IDEA 2021.2.1\plugins\maven\lib\maven3\bin\m2.conf” “-Dmaven.ext.class.path=D:\JetBrains\IntelliJ IDEA 2021.2.1\plugins\maven\lib\maven-event-listener.jar” “-javaagent:D:\JetBrains\IntelliJ IDEA 2021.2.1\lib\idea_rt.jar=50185:D:\JetBrains\IntelliJ IDEA 2021.2.1\bin” -Dfile.encoding=UTF-8 -classpath “D:\JetBrains\IntelliJ IDEA 2021.2.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;D:\JetBrains\IntelliJ IDEA 2021.2.1\plugins\maven\lib\maven3\boot\plexus-classworlds.license” org.codehaus.classworlds.Launcher -Didea.version=2021.2.1 -s D:\workspace\apache-maven-3.9.5\conf\settings.xml package
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: ‘blocked’ (position: START_TAG seen …\n … @165:16) @ D:\workspace\apache-maven-3.9.5\conf\settings.xml, line 165, column 16
[WARNING]
[INFO] Scanning for projects…
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — maven-resources-plugin:3.3.1:resources (default-resources) @ demo —
[INFO] Copying 1 resource from src\main\resources to target\classes
[INFO] Copying 0 resource from src\main\resources to target\classes
[INFO]
[INFO] — maven-compiler-plugin:3.11.0:compile (default-compile) @ demo —
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 1 source file with javac [debug release 1.8] to target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.930 s
[INFO] Finished at: 2023-11-24T18:26:48+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project demo: Fatal error compiling: 无效的标记: --release -> [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

Process finished with exit code 1

问题原因

版本不兼容
spring boot版本跟jdk版本不兼容
我使用是spring boot版本3.16

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.1.6</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

jdk1.8

在这里插入图片描述

解决方案

1.升级jdk版本为11或以上

2.减低spring boot版本

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
  • 21
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值