gpt4 book ai didi

java - 在 pom.xml 中更改为 java8

转载 作者:行者123 更新时间:2023-12-01 22:14:55 24 4
gpt4 key购买 nike

在 pom.xml 中将 java 版本更改为 1.8 后,在运行 mvn install 时仍然收到以下错误消息:

lambda expressions are not supported in -source 1.6 
(use -source 8 or higher to enable lambda expressions)

我的 maven-compiler-plugin。

                <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<encoding>${project.build.sourceEncoding}</encoding>
</compilerArguments>
</configuration>
</plugin>

最佳答案

也尝试将其添加到您的 pom.xml 中:

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

关于java - 在 pom.xml 中更改为 java8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31266893/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com