Maven报错:不再支持源选项 5。请使用 7 或更高版本。

在尝试编译Maven项目时遇到了一个错误,提示不再支持源选项5,建议使用7或更高版本。这表明项目的Java源代码版本设置不正确。为解决此问题,需要在pom.xml中添加或更新Java版本配置,如下所示:`<java.version>1.8</java.version><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target>`。完成这些更改并重新运行Maven编译应该可以解决问题。
摘要由CSDN通过智能技术生成

PS D:\mavenRepository\helloMaven> mvn compile
[INFO] Scanning for projects…
[INFO]
[INFO] -------------------------< com.tjh:maven-demo >-------------------------
[INFO] Building maven-demo Maven Webapp 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ maven-demo —
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ maven-demo —
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling 1 source file to D:\mavenRepository\helloMaven\target\classes
[INFO] -------------------------------------------

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值