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 :
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[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
Click on Java > Installed JRE’s
Here you will get JRE now we need to change it to JDK.
Now we need to add JDK > Click on Add > Select Standard VM
Browser JDK where it is located. Generally, you will get JAVA in below location.
Now once JDK set you are done.
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|