0

Today when I open Eclipse it shows me errors on a lot of rows. What happened? enter image description here

Robin Green
  • 32,079
  • 16
  • 104
  • 187
SlaaSh
  • 99
  • 1
  • 6

1 Answers1

1

Each of those errors is a compilation error, where the compiler tells you a class is not present in the build path for your project. And of course all of those are classes which are included in the JDK.

Looks like Eclipse lost the workspace main JRE, and that is sometimes due to Java himself updating online overnight, and deleting the old JDK installation. To fix that, restore the workspace JRE and assign it to your project.

To restore the JRE: go to

Window>Preferences>Installed JREs
remove any JRE you have (you probably have one in a red state)
add a new Workspace JRE and make it the default:
Click on Add>Standard VM> As Java home, use the main folder where your JDK is installed.

Reassign it to your project:

Right click on Project>Properties>Java Build Path>Libraries
Remove the current JRE library (if it is in a red state),
Re-assign the JRE:
Select Add Library>JRE System Library>and use the workspace default.

Click on Apply, clean and build your project, compilation should be successful.

Daniele
  • 2,672
  • 1
  • 14
  • 20