如果在JAVA EE IDE上運(yùn)行tomcat7:run的時(shí)候出現(xiàn)以下錯(cuò)誤〔馍埃可以參照下方的解決方案
[ERROR]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Resrauran
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] ? mvn -rf :xinghe-interaction
解決方法:
右鍵點(diǎn)擊項(xiàng)目,在彈出的菜單中選擇properties:
點(diǎn)開(kāi)后屈嗤,選擇Maven項(xiàng)目中的Project Facets,有可能不會(huì)顯示以下內(nèi)容圆米,應(yīng)該會(huì)出現(xiàn)一行藍(lán)字(已經(jīng)點(diǎn)過(guò)了,所以就沒(méi)辦法截屏了)声畏,點(diǎn)擊一下就會(huì)出現(xiàn)如下內(nèi)容撞叽,再點(diǎn)擊Runtimes,勾選Apache Tomcat v7.0(或其他版本)姻成,然后點(diǎn)擊ok就解決了:
如果沒(méi)有Apache Tomcat v7.0,就點(diǎn)擊“new",并選擇下載在本地的Tomcat版本相對(duì)應(yīng)的版本號(hào)愿棋。并且點(diǎn)擊"Next”:
最后選擇路徑和JRE就解決了科展。