Search This Blog

Breaking

Wednesday, 12 May 2021

Jenkins: [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [Fix]

 Recently, When I was trying to run my Automation Job in Windows environment, I stuck with one issue, Where in Jenkin console, It started throwing error:

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







I first navigated to that directory where Jenkin took the clone and later ran my maven command there. It worked fine and didn't give any error. It helped me to narrowed down to find the soltution.

In local, where my pom.xml file was present, I tried to run the same command , and here also it worked.

I started googling about this failure.  I found few answer in stackoverflow, but the which which worked in my case was:

to add 

<fork>true</fork>

inside my pom.xml file.

Now My pom file started looking like this:

<plugins>

    <plugin>

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

        <version>3.1</version>

        <configuration>

            <fork>true</fork>

        </configuration>

    </plugin>

</plugins>


This worked fine and didn't impacted the other jobs also which I was running.

Link: StackOverFlowLink

No comments:

Post a Comment