• Register
0 votes
143 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

Please log in or register to answer this question.

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 2
3,890 points

Related questions

0 votes
1 answer 11 views
11 views
Problem: I'm compiling a project in Eclipse using m2eclipse. But this is showing an error: No compiler is provided in this environment. perhaps you are running on a jre rather than a jdk
asked Apr 23 ummeshani 9.4k points
1 vote
1 answer 8 views
8 views
Problem: I’m getting this error when I try to compile a project . [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] No compiler is provided in this environment. Perhaps you ... a JDK?I’m using Eclipse m2eclipse . The JDK path set in Eclipse is : Windows-->preferences-->installed jres--> jdk1.7.xx pathAny help will be appreciated .
asked Apr 22 Raj Tyagi 14.9k points
0 votes
1 answer 8 views
8 views
Problem: I'm compiling a project in Eclipse using m2eclipse. I get an error: [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
asked Apr 2 ummesalma 29.2k points
1 vote
1 answer 5 views
5 views
Problem: How can I deal with this problem : perhaps you are running on a jre rather than a jdk
asked Apr 4 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 7 views
7 views
Problem: I need a help , How I can fix this : perhaps you are running on a jre rather than a jdk maven
asked Apr 4 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 6 views
6 views
Problem : Please help to get rid of this > Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved.
asked Apr 24 Abik Dey 4k points
0 votes
1 answer 38 views
38 views
Problem: web.xml is missing and <failonmissingwebxml> is set to true.
asked Feb 17 Dan phillip 4.8k points
0 votes
1 answer 4 views
4 views
Problem: I have imported maven project in STS, when I run update update project I receive: "Updating Maven Project". Unsupported IClasspathEntry kind=4 Is there a workaround for this?
asked Apr 22 ummeshani 9.4k points
0 votes
1 answer 25 views
25 views
Problem: java se development kit (jdk) was not found on this computer.
asked Feb 16 Ethan ross 2.7k points
0 votes
1 answer 2 views
2 views
Problem: How to fix this error > A java runtime environment (jre) or java development kit (jdk) must be available
asked Apr 26 ummeshani 9.4k points