1、今天在使用springboot进行clean和package出现了错误,maven的错误如下:
Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:3.1:compile (default-compile) on project TEST-WEB: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
2、他的意思是没有jdk,maven中使用的是jre,所以要使用本地的jdk,
3、打开eclipse,选择Windows–>preferences–>java–>installed jres–>add
4、选择最后一个 点击next
5、选择jdk的安装路径,一定要到内部的jdk目录,不然还是会出现错误。
6、然后确定,并且使用自己本地的jdk,然后在运行就一切正常。