Java Maven无效目标版本:13
我在Eclipse中使用Maven,我想用Java13运行我的项目。每次构建项目时,我都会收到以下错误消息:Java Maven无效目标版本:13,java,maven,build,java-13,Java,Maven,Build,Java 13,我在Eclipse中使用Maven,我想用Java13运行我的项目。每次构建项目时,我都会收到以下错误消息: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project subscriptionsmanager: Fatal error compiling: invalid target release: 13 -> [Help
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project subscriptionsmanager: Fatal error compiling: invalid target release: 13 -> [Help 1]
我在
中配置了pom.xml文件,如下所示:
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>13</maven.compiler.source>
<maven.compiler.target>13</maven.compiler.target>
UTF-8
13
13
Java13作为来自Eclipse的JRE,来自Eclipse的“Java构建路径”部分
是否有我没有考虑过的设置?根据建议,您需要显式配置maven编译器插件:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>13</source>
<target>13</target>
</configuration>
</plugin>
...
org.apache.maven.plugins
maven编译器插件
3.8.1
13
13
...
mvn命令使用JAVA\u HOME
或路径中的JAVA
,因此请检查这些配置是否正确。此外,请注意JAVA 13已过时。最好使用java 11或java 15。@利诺,你知道我如何检查我在Eclipse中的路径吗?@ PZ7路径是从你的操作系统(OS)中,所以你必须检查你的设置中的某个地方。考虑更新你的插件从<代码> Maven编译器插件:3.1 < /代码>到<代码> Maven编译器插件:3.81