更新时间:2021-11-09 17:46:19
发生错误是因为代码不适用于那里使用的默认编译器.在声明依赖项之后,在根元素结束之前将此代码粘贴到有效 POM 中,以更改使用的编译器.根据需要调整版本.
The error occurred because the code is not for the default compiler used there. Paste this code in effective POM before the root element ends, after declaring dependencies, to change the compiler used. Adjust version as you need.
<dependencies>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
无法执行目标org.apache.maven.plugins:项目中的maven-compiler-plugin(default-compile):致命错误编译:未找到tools.jar
无法使用带有错误的MAVEN构建 - 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
Maven构建编译错误:无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.1:在项目Maven上编译(default-compile)
无法使用带有错误的 MAVEN 构建 - 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.1:compile