Failed to compile resources with the following parameters:

本文讨论了JDK 9.0与SDK版本不匹配的问题,并提出了两种解决方案:升级SDK或者将JDK版本降级到8.0。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >




jdk是9.0的跟sdk的等级不匹配了,要吗升级sdk的要么把jdk降级到8.0

运行应用时报错 mvn spring-boot:run PS D:\project_test\demo\demo> mvn spring-boot:run [INFO] Scanning for projects... [INFO] [INFO] --------------------------< com.example:demo >-------------------------- [INFO] Building demo 0.0.1-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] >>> spring-boot:3.4.4:run (default-cli) > test-compile @ demo >>> [INFO] [INFO] --- resources: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] --- compiler:3.13.0:compile (default-compile) @ demo --- [INFO] Recompiling the module because of changed source code. [INFO] Compiling 1 source file with javac [debug parameters release 17] to target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /D:/project_test/demo/demo/src/main/java/com/example/demo/DemoApplication.java:[3,32] 无法访问org.springframework.boot.SpringApplication 错误的类文件: C:\Users\25324\.m2\repository\org\springframework\boot\spring-boot\3.4.4\spring-boot-3.4.4.jar(org/springframework/boot/SpringApplication.class) 类文件具有错误的版本 61.0, 应为 52.0 请删除该文件或确保该文件位于正确的类路径子目录中。 [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.282 s [INFO] Finished at: 2025-03-21T21:26:58+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project demo: Compilation failure [ERROR] /D:/project_test/demo/demo/src/main/java/com/example/demo/DemoApplication.java:[3,32] 无法访问org.springframework.boot.SpringApplication [ERROR] 错误的类文件: C:\Users\25324\.m2\repository\org\springframework\boot\spring-boot\3.4.4\spring-boot-3.4.4.jar(org/springframework/boot/SpringApplication.class) [ERROR] 类文件具有错误的版本 61.0, 应为 52.0 [ERROR] 请删除该文件或确保该文件位于正确的类路径子目录中。 [ERROR] [ERROR] -> [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/MojoFailureException PS D:\project_test\demo\demo>
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值