• Register
0 votes
80 views

Problem :

I want to compile a project in Eclipse using the m2eclipse. I set my JDK path in Eclipse as below:

Windows-->preferences-->installed jres--> jdk1.7.xx  path

But this is showing me below error

[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
[INFO] ------------------------------------------------------------------------

 

7 5 2
3,870 points

2 Answers

0 votes

Solution :

1.On the Eclipse IDE, just go into the Window > Preferences > Java > Installed JREs > and just try to check your installed JREs. You should have some entry with your JDK there.

2.Select your Execution Env and click OK

3.Then just Right-Click on the Project -> Maven -> Update Project

You can change your Maven JRE as follows. You need to Go to Run -> Run Configurations, selecting your Maven Build I was running (from my left panel). Then just click a JRE tab and select a option Workspace default JRE

OR

1.Set your JAVA_HOME environment variable to a JDK root folder it is required if you run command line or the maven (mvn).

2.From a project properties in a section Java Compiler select a required JDK it is required if you run it directly from a eclipse

9 7 4
38,600 points
0 votes

If you have downloaded Eclipse or STS IDE for spring projects, it is possible that while compiling or running java project you may get the following error with BUILD FAILURE message in the console,

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

What does this error describe?

This error does not mean that your project has some problems but is because some wrong java related configuration in your IDE which you must correct to successfully run your project.

Solution:

To fix this solution you have to update your IDE preferences. The solution assumes that you are using the Eclipse for project development.

Steps to resolve the issue:

  • Go to windows -> Preferences -> Java -> Installed JREs and after that check your installed JREs. You should have an entry with JDK there. But because you are seeing this error, you will find an entry for JRE instead.
  • Now select the entry. Click on it and Edit. After that change the path from JRE to JDK.
  • Once you have changed the installed JRE to JDK, Click on Apply and close.
  • If you have a Maven project, Right-click on your project -> Maven -> Update project.

I hope this will help to solve your issue.

11 5 1
3,890 points

Related questions

1 vote
2 answers 129 views
129 views
Problem: Dear all, Right now I’ve imported a maven project into my eclipse IDE and I changed my java path library to work on java 1.7 Suddenly, eclipse started showing an error but I’ve got no errors in my files there. The error is “java compiler level ... Project Problem (Java Version Mismatch) Please tell me how to resolve this error (I want to have my JRE version as 1.7 only).
asked Mar 22 Gavin 15.3k points
1 vote
1 answer 199 views
199 views
Problem: Hello Guys, I am trying to import a Maven project in my Eclipse IDE but the project is not importing properly. It shows an error, source folder is not a java project when I m trying to give it a new call-in it. The problem is literally going over my head ... the problem, as well as have a solution, please speak up. I'm surfing over the internet for an hour but couldn’t fix this yet.
asked Apr 2 Gavin 15.3k points
0 votes
1 answer 31 views
31 views
Problem: I am very new to eclipse and maven. Currently I am using the Eclipse Luna with a m2e plug-in. If I try to search for dependencies then I immediately receive the subsequent warning message: “Index downloads are disabled, search result may be incomplete. ... exact solution on my above error. So I want to know the way to enable index downloads in my Eclipse for Maven dependency search.
asked Aug 13 Raphael Pacheco 4.9k points
0 votes
1 answer 43 views
43 views
Problem : I created a project by Maven integration in Eclipse , but in the work space in all JSP files have bellow message: The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
asked Oct 31, 2019 peterlaw 6.9k points
0 votes
1 answer 13 views
13 views
Problem: I am trying to load Java Web App into the Eclipse (via the Import Maven Project) but I am facing below error which says: "Cannot change version of project facet Dynamic Web Module to 2.5". I am trying to do research on the above error and one thing I ... >  <installed facet="wst.jsdt.web" version="1.0"/> </faceted-project> Can someone help me in fixing above project facet related error.
asked Jul 7 Raphael Pacheco 4.9k points