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] -------------------------------------------
Maven报错:不再支持源选项 5。请使用 7 或更高版本。
最新推荐文章于 2024-07-11 22:32:13 发布
在尝试编译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通过智能技术生成