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?
Table of Contents
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
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.
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?
Join Our News Letter – Stay Updated
Subscribe to Awesome Java Content.