无效的标记: --release 解决

编译失败的报错信息如下D:\Software\Java\jdk1.8.0_351\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\04_01存档资料\project\Seconde_hand\Seconde_hand -Djansi.passthrough=true -Dmaven.home=D:\Software\maven\apache-maven-3.9.0 -Dclassworlds.conf=D:\Software\maven\apache-maven-3.9.0\bin\m2.conf "-Dmaven.ext.class.path=D:\04_02 IJ_ java\Idea2023\IntelliJ IDEA 2023.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\04_02 IJ_ java\Idea2023\IntelliJ IDEA 2023.2\lib\idea_rt.jar=19776:D:\04_02 IJ_ java\Idea2023\IntelliJ IDEA 2023.2\bin" -Dfile.encoding=UTF-8 -classpath D:\Software\maven\apache-maven-3.9.0\boot\plexus-classworlds-2.6.0.jar;D:\Software\maven\apache-maven-3.9.0\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2023.2 -s D:\Software\maven\apache-maven-3.9.0\conf\settings.xml -Dmaven.repo.local=D:\Software\maven\repository install -P !JDK-1.8
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.campus:second-hand >-----------------------
[INFO] Building second-hand 1.0.0
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ second-hand ---
[INFO] Copying 1 resource from src\main\resources to target\classes
[INFO] Copying 56 resources from src\main\resources to target\classes
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ second-hand ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ second-hand ---
[INFO] skip non existing resourceDirectory D:\04_01存档资料\project\Seconde_hand\Seconde_hand\src\test\resources
[INFO] 
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ second-hand ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\04_01存档资料\project\Seconde_hand\Seconde_hand\target\test-classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.243 s
[INFO] Finished at: 2025-09-12T20:55:07+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile (default-testCompile) on project second-hand: 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

 改 IDEA 设置(推荐)Settings ➜ Build Tools ➜ Maven ➜ Importing & Runner ➜ 把 JDK for importer / Runner 全部改成 JDK 11+
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值