[英]Maven Java error compiling on build: maven-compiler-plugin
When I try to run as maven build it always give BUILD FAILURE
.当我尝试以 maven 构建运行时,它总是给出
BUILD FAILURE
。
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project testJPA: Fatal error compiling: invalid target release: 11 -> [Help 1]
I already tried the following things:我已经尝试过以下事情:
> java -version
java version "1.8.0_261"
> echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_211
pom.xml pom.xml
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
None of them worked.他们都没有工作。 Any guesses?
有什么猜测吗?
I managed to find a solution.我设法找到了解决方案。
I installed JDK 11 and set it at Window > Preferences > Java > Installed JREs > Add > jdk-11.0.9我安装了 JDK 11 并将其设置为Window > Preferences > Java > Installed JREs > Add > jdk-11.0.9
Downloaded at: https://www.oracle.com/java/technologies/javase-jdk11-downloads.html下载地址: https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.