Reputation: 401
In Eclipse, I am getting an error:
Build path specifies execution environment Java SE 1.7.
There are no JREs installed in the workspace that are strictly compatible with this environment.
Upvotes: 27
Views: 152312
Reputation: 1
If the above solutions don't solve your problem try using the latest Eclipse version.
Surely this will solve your problem.
I was using the older version i.e., Eclipse version 2020-03 which is not at all compatible with Java-17.
Upvotes: 0
Reputation: 77
<< If you're using Gradle >>
set gradle java-home in windows>preferences. And see project's config. so Gradle won't use eclipse default jvm and let you work with another jre.
Upvotes: 0
Reputation: 1
Exact Solution Right click on your project
Properties
Java Build Path --> Libraries and enter image description here
Modulepath --> Add Library enter image description here
JRE System Library, next> choose "Workspace default JRE" AND finish. Solved!
Upvotes: 0
Reputation: 2315
Solved by
Right click on JRE System Library
Select Properties
Choose Workplace Default JRE
Apply and Close
Upvotes: 1
Reputation: 1538
I have this situation because I have multiple JDKs, and the JREs are nested below them. I'm building a JRE8 project but my current default is the latest v11. So the challenge is to get Eclipse to recognize the JDK>JREv8.
On build the error goes away. :)
Upvotes: 1
Reputation: 54
Upvotes: 0
Reputation: 91
This should work:
C:\Program Files\Java\jdk1.7.{x}
.
If you don't have it, you need to install it.C:\Program Files\Java\jdk1.7.0_80
."Execution environment" will be JavaSE-1.7 (jdk1.7.0_80) now.
Upvotes: 9
Reputation: 1
Go To Control Panel - check whether any new java version Updated -Uninstall it and Configure the Build Path JRE Library "Execution environment" to the Previous Version.
Probably if Java 7 is updated to Java 8 the above problem will occur. To avoid that warning, just you can uninstall the new update and restore the old version in execution environment.
Upvotes: 0
Reputation: 89
Go to Project|Properties Choose the Java Build Path section Select the current JRE System Library, and choose Remove Select Add Library, and under the JRE System Library category pick your system library; you probably just need to choose the Workspace default JRE
More generally, under Window|Preferences, you can check Java|Installed JREs|Execution Environments to know which of the installed JREs match a specific execution environment.
Upvotes: 8
Reputation: 9541
Sounds like what I had after installing a newer Eclipse.
My solution:
Window->Preferences, Java->Installed JREs->Execution Environment.
Click the correct environment in the left panel, probably JavaSE-jre7
If the checkbox in the right panel is empty, check it.
If it's checked, but it isn't named jre7 [perfect match] then find the one in the left panel that does have 'perfect match' on the right and check that instead.
Upvotes: 3
Reputation: 4609
Try this
In Eclipse,
your project
-> properties
-> java build path : Libraries
Remove the "JRE System Library[J2SE 1.4]"
-> click "Add Library" button -> JRE System Library
-> select the new "Executin Environment" or Workspace default JRE
Upvotes: 67