To fix running into the java.lang.Object cannot be resolved issue in Eclipse, perform the following:
Set up JDK in the Build Path:
Right Click on the project and hover on the Build Path, then select correct Configure Build Path.
In the Libraries tab, remove any JRE System Library if present.
Press Add Library… > JRE System Library > Next, and either select the Workspace Default JRE or any installed JDK.
Press Finish and then Apply and Close.
Check the Installed JRE is Correct:
Go to the Window > Preferences > Java > Installed JREs.
Ensure that you have checked the JDK (not only JRE) which is set to the correct path.
Cleans and Re Compiles the Project:
Click on Project > Clean… > select your project > press OK.
This should solve the issue at hand.