• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Selenium tips and tricks / How to solve No compiler is provided in this environment while running Maven build

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

April 2, 2020 by Mukesh Otwani 35 Comments

Eclipse-Change

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

When you run the 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 comes 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 change that you need to perform in order to make it work.

  I have a dedicated video on this.

 

Solution 1- 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.

Solution 2- Using Maven compiler plugin

Using Maven compiler plugin we can provide JAVAC (Java Compiler) path, which will fix the issue.

You can open your pom.xml file and add below changes in pom.xml

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.8.1</version>

<configuration>

<verbose>true</verbose>

<fork>true</fork>

<executable>${JAVA_HOME}/bin/javac</executable>

</configuration>

</plugin>

Where JAVA_HOME is the path variable which we have set earlier while installing Java.

Note- I personally prefer the second solutions which work across multiple platforms.

 

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

Filed Under: Selenium tips and tricks Tagged With: no compiler is provided in this environment. perhaps you are running on a jre rather than a jdk?, Solution for No compiler is provided in this environment in Maven

Reader Interactions

Comments

  1. Eduardo Rodrigues says

    September 23, 2023 at 5:52 AM

    Awesome, thank you for the outstanding guide. My school library’s lab environment had us running Maven using a JRE, luckily they had a SDK ready for us to set as JAVA_HOME.

    Reply
    • Mukesh Otwani says

      October 9, 2023 at 1:52 PM

      Nice I am glad it helped.

      Reply
  2. DEVANAND DURG says

    January 12, 2021 at 10:18 AM

    Thank you so much it worked

    Reply
    • Mukesh Otwani says

      January 12, 2021 at 4:51 PM

      Glad to see your comment…:)

      Reply
  3. richa says

    May 29, 2020 at 11:27 AM

    Addiing this plugin,generates error in the pom.xml file.

    Reply
    • Mukesh Otwani says

      May 29, 2020 at 1:45 PM

      Hi Richa,

      I hope that you are using Java 8?

      Reply
  4. AlexB says

    April 26, 2020 at 1:39 PM

    Great!!! fixed the issue

    Reply
    • Mukesh Otwani says

      April 26, 2020 at 9:30 PM

      Glad to hear from you 🙂

      Reply
  5. Utkarsh Anand says

    February 28, 2020 at 6:48 PM

    Thank you for making this info available. It solved my issue.

    Reply
    • Mukesh Otwani says

      February 28, 2020 at 10:34 PM

      Hi Utkarsh,

      You’re always welcome to ask your doubts…:)

      Reply
  6. karthik says

    December 1, 2019 at 9:23 PM

    thank you for this information, helped me to overcome issues in my maven build.

    Reply
    • Mukesh Otwani says

      December 2, 2019 at 9:38 AM

      Hi Karthik,

      Glad to hear from you.
      You’re always welcome to my blog…:)

      Reply
  7. Alekhya Vandanapu says

    September 30, 2019 at 2:08 PM

    Thanks a lot Its working

    Reply
    • Mukesh Otwani says

      September 30, 2019 at 4:04 PM

      Hi Alekhya,

      You’re welcome…
      Feel free to ask your doubts…:)

      Reply
  8. jaffar says

    August 5, 2019 at 9:55 AM

    Hi mukesh,

    I got this error “Target is not a JDK Root. System library was not found.”. I am using eclipse neon and jdk version is 12.0.2.

    C:\Program Files\Java\jdk-12.0.2 -> this is my path of JDK

    Regards,
    Jaffar

    Reply
    • Mukesh Otwani says

      August 5, 2019 at 10:30 AM

      Hi Jaffar,

      Kindly uninstall JDK 12 -> Restart system -> Then install JDK 8

      Reply
  9. Mukesh Otwani says

    May 20, 2019 at 1:56 PM

    Hi Saurav,

    In that case you can use below plugin in POM.xml file

    Note- Change the path accordingly. maven-compiler-plugin
    3.3

    true
    C:\Program Files\Java\jdk_1.8\bin\javac.exe

    Reply
  10. kevin says

    May 4, 2019 at 11:17 PM

    Thank you good human!

    Reply
  11. Imtiyaz says

    January 31, 2017 at 2:03 AM

    Thanks Mukesh. This helped a lot.

    Reply
    • Mukesh Otwani says

      January 31, 2017 at 1:30 PM

      Thanks Imtiyaz

      Reply
  12. Gaurav Kantrod says

    January 30, 2017 at 11:27 AM

    Amazing and easy explanation.

    Reply
    • Mukesh Otwani says

      January 30, 2017 at 12:42 PM

      Thanks Gaurav 🙂 keep visiting and let me know if any help.

      Reply
  13. Shakti Das says

    January 26, 2017 at 8:35 AM

    Nice Blog Boss,Very clear and prescribed manner.

    Reply
    • Mukesh Otwani says

      January 26, 2017 at 6:01 PM

      Hi Shakti,

      Thanks for your comments.

      Reply
  14. Andres says

    December 3, 2016 at 12:56 AM

    Thanks a lot!!!

    Reply
    • Mukesh Otwani says

      December 6, 2016 at 12:00 PM

      Welcome Andres.

      Reply
  15. NG says

    October 1, 2016 at 4:49 PM

    thanks a lot.

    Reply
    • Mukesh Otwani says

      October 3, 2016 at 4:27 PM

      Welcome mate.

      Reply
  16. saurav kumar says

    August 27, 2016 at 1:20 PM

    Thanks a lot Mukesh. I learns a lots from your website.keep it up.

    Reply
    • Mukesh Otwani says

      August 27, 2016 at 3:04 PM

      Thanks Saurav 🙂 Keep visiting.

      Reply
  17. isub897 says

    August 18, 2016 at 7:49 PM

    Solid bro. Most straight forward example I’ve seen. Cheers

    Reply
    • Mukesh Otwani says

      August 18, 2016 at 10:40 PM

      Thanks Mate 🙂

      Reply
  18. Kanchana says

    July 5, 2016 at 1:26 PM

    Hi Mukesh,

    Can you please provide me the Folder Structure in selenium using Maven and without using Maven.

    and also GIT commands.

    Regards,
    Kanchana

    Reply
  19. nik says

    March 24, 2016 at 5:36 AM

    you are GOD . Thank you

    Reply
    • Mukesh Otwani says

      March 26, 2016 at 1:56 PM

      Thanks a ton Nik 🙂 You made my day. PLease let me know if you need any help from my side.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

Video Player
https://www.youtube.com/watch?v=w_iPCT1ETO4
00:00
00:00
31:21
Use Up/Down Arrow keys to increase or decrease volume.

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • Syllabus For Playwright Online Training Program
  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?