Wednesday, December 19, 2018

Eclipse maven build failure No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

We get below error when you try to build java project using maven install in eclipse.

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] ------------------------------------------------------------------------

This is basically due to incorrect configuration of JDK in eclipse java JRE definitions.

Go to : Window > Preferences > Java > Installed JREs and see if you don't see JDK there then we need to add its entry.

 

Click on add and select Standard VM and Select JRE home to JDK which you have set in JAVA_HOME.
 

Same way select the Execution Environments as below :
Go to : Window > Preferences > Java > Installed JREs > Execution Environments

 

Refresh and run maven install.

No comments:

Post a Comment