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

Previous

If you are getting below error while running the Maven build.

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


There are 3 ways to solve this error.


Eclipse maven error

If you are getting this error, while doing maven build on eclipse then you must check if you re using JDK rather JRE in eclipse.

    • In eclipse, click on Window -> Prefererences -> Java -> Installed JREs
    • Verify that JDK is checked rather than JRE.

    • If JRE is checked, then you need to add JDK by clicking on Add -> Standard VM -> Next -> Directory and browse the JDK path

InstalledJDK

This will resolve error in eclipse.


Add executable in pom.xml

You can set fork to true and exectuable to fully qualified JDK path  in maven-compiler-plugin.


Set JAVA_HOME to JDK

Go to System properties -> Advanced system settings -> Advanced -> environment variable and add JAVA_HOME to envrionment variable.
Java_Home
Reference: https://stackoverflow.com/questions/19655184/no-compiler-is-provided-in-this-environment-perhaps-you-are-running-on-a-jre-ra
I hope this will resolve the error.That’s all about No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Previous

Join Our News Letter – Stay Updated

Subscribe to Awesome Java Content.




Add Comment

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog