1. 程式人生 > >關於maven項報:[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rath

關於maven項報:[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rath

關於eclipse建立maven工後進行測試報[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?的解決辦法:
報錯資訊如下:
[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: 1.436 s
[INFO] Finished at: 2017-06-28T11:16:07+08:00
[INFO] Final Memory: 10M/151M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project manage: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]

解決方法:只需要將預設的jre改為自己電腦安裝的jre即可:
右鍵點選專案名稱—>build path–>configure build path
然後:
在這裡插入圖片描述
在這裡插入圖片描述