The following error message:
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.103 s [INFO] Finished at: 2019-08-26T17:41:36+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project springmvc: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
According to the error message prompts: No compiler is provided in this environment Perhaps you are running on a JRE rather than a JDK.?
This environment does not provide a compiler. Perhaps you are running JRE instead of the JDK?
1: First View Eclipse -> Window -> preferences - > Java -> Installed JREs
really java compiler environment is jre, and run maven project needs to specify a configuration consistent with the JDK environment, so we configure a jdk directory, and specify the directory as jdk, and in order to prevent the mistake, I deleted the directory jre
2: Project Right -> build path -> configure build path -> java Build Path -> Next image manipulation
3. Project Right -> run as -> run configurations ..--> jre -> execution environment selected jdk just configuration -> run
the above!