1. 程式人生 > >tomcat或maven啟動服務error解決辦法(一)

tomcat或maven啟動服務error解決辦法(一)

最近用maven啟動專案突然不行了,報錯資訊如下:

[ERROR] COMPILATION ERROR : 

[INFO] -------------------------------------------------------------
[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: 2.070 s
[INFO] Finished at: 2016-09-23T10:12:38+08:00
[INFO] Final Memory: 13M/32M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project *********: 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

報錯資訊說的已經很清楚了,解決辦法有如下三種(由於本渣用的是中文版,相關路徑就用中文表示了,見諒):

一、你用的就是JDK,但是由於版本低,所以報錯,最簡單的辦法就是升級一下自己用的JDK

二、視窗-->首選項-->伺服器-->執行時環境-->選擇自己用的tomcat選編輯-->JRE:選擇JDK

如此解決之後tomcat的服務就可以成功啟動了,但是maven還是不行,實在沒辦法我把組裡的大哥叫來幫忙,過來之後他做了第三個辦法成功解決maven無法啟動的問題

三、專案右鍵-->執行方式-->執行配置-->選自己的maven服務啟動配製-->如下圖


我靠坑爹啊,原來在這藏著呢,當時大哥的表情貌似在告訴我:就這問題就難住你了?Are you kidding me?

這三種辦法基本上就可以完美解決這種報錯了,如果有不足之處,請點醒改正,感謝觀看。