How to solve No compiler is provided in this environment while running Maven build

In this article, I am going to discuss the basic issue which you might face while working with Maven. No compiler is provided in this environment in Maven will only come when you run maven build first time. In this case we need to make certain changes which will fix your issue.

When you run maven build through eclipse then you might get below error. If you try to read the error log it says clearly that no compiler is detected so in this we can change the JRE to JDK.

You will not get this error if you are running through Jenkins this only come when running via Eclipse or CMD.

The error will be like

Error message for No compiler is provided in this environment in 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

 

Do not worry about this issue because it is just a small configuration that you need to perform in order to make it work.

 

Solution for No compiler is provided in this environment in Maven

Click on Windows > Click on preferences

 

No compiler is provided in this environment in Maven

 

 

Click on Java > Installed JRE’s

Here you will get JRE now we need to change it to JDK.

 

No compiler is provided in this environment in Maven

 

Now we need to add JDK > Click on Add > Select Standard VM

No compiler is provided in this environment in Maven

 

 

Browser JDK where it is located. Generally, you will get  JAVA in below location.

No compiler is provided in this environment in Maven

 

Now once JDK set you are done.

 

No compiler is provided in this environment in Maven

 

Now you can run pom.xml file from Eclipse or through CMD and Run pom.xml file > Maven clean then Maven Install and Finally Maven build.

 

You can like our Facebook Page for more updates Learn Automation Page
Join our facebook group for any query Selenium Group Discussion

17 Comments

  1. Imtiyaz
  2. Gaurav Kantrod
  3. Andres
  4. NG
  5. saurav kumar
  6. isub897
  7. Kanchana
  8. nik