gpt4 book ai didi

java - 另一个Maven "Source option 6 is no longer supported. Use 7 or later."

转载 作者:行者123 更新时间:2023-12-03 09:33:08 26 4
gpt4 key购买 nike

我看到了这个问题的很多答案,但它们对我没有用。我在PC上安装了Visual Studion Code,Java和Maven的最新版本,并且能够在PC上使用Maven成功构建应用程序。然后,我在Mac上执行了相同的步骤,但出现此错误。

Macos,Visual Studio Code,Maven和Java的新版本。就像所有其他人所说的那样,我将以下行添加到了pom.xml文件的properties部分:

    <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

仍然会出现相同的错误。这是mvn构建的相关输出:
alberts-mbp:com.versabuilt.rushmore.process albertyoungwerth$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< com.versabuilt.rushmore.process:VersaBuiltProcess >----------
[INFO] Building VersaBuilt Process 0.2.18
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ VersaBuiltProcess ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ VersaBuiltProcess ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 10 source files to /Users/albertyoungwerth/rushmore/com.versabuilt.rushmore.process/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.
[INFO] 2 errors

我也没有重新启动Visual Studio Code。请让我知道其他有用的信息。谢谢!

最佳答案

实际上,将其添加到属性文件后,我也面临上述错误消息,错误得到解决。 :)
property need to be added in pom.xml

 <properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

关于java - 另一个Maven "Source option 6 is no longer supported. Use 7 or later.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61860989/

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