另一个 Maven “源选项 6 不再受支持。使用 7 或更高版本。
2022-09-02 09:52:19
我看到很多这个问题的答案,但它们不适合我。我在PC上安装了Visual Studio Code,最新版本的Java和Maven,并且能够在PC上使用Maven成功构建我的应用程序。然后,我在Mac上执行了相同的步骤,并得到了此错误。
Macos,Visual Studio Code,Maven和Java的新版本。就像其他人说的那样,我将这些行添加到我的pom.xml文件的属性部分:
<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,但无济于事。