No
compiler is provided in this environment. Perhaps you are running on a JRE
rather than a JDK?
Whenever the first time we set up our project code in eclipse and try to execute code, I am
very sure most of you came across to one of this common error stating “No
compiler is provided in this environment. Perhaps you are running on a JRE
rather than a JDK?”.
In
this article, we will see how we can resolve this error for the eclipse.
To
solve this error for the eclipse we have two simple Methods.
First
Method
1)
On your Eclipse IDE, go into Window > Preferences > Java > Installed
JREs > and check your installed JREs. You should have an entry
with a JDK there.
2)
In case no entry for JDK, Click on Add and Select Standard VM
and add the path of JDK installed on your machine.
3)
Click on Apply and Close option present on the Screen.
Now
once we execute our code we won't be facing this error.
Second
Method
- In your project POM.xml inside build, section add maven compiler plugin with the path of your Javac installed in your local and save the changes.
- Build your project once again.
- Now once
again we have executed our code we won't be facing this error.