Is this a new bug? I got a new mac computer and install eclipse on it. The checksum matches fine. But when I try to create a simple class, just for basic testing, I get the
This problem occurs if your JRE is not configured in project built path.
To configure JRE:
In Eclipse:
Build Path -> Configure Build PathLibraries tab click Add Library.JRE System Library click NextJRE from options as per your requirement. Click FinishIn Netbeans:
Properties.Java Platform as per your requirement. Source/Binary Format and select JDK as per your requirement.Explanation:
The error was because you did not include System libraries in your project and your class was not able to find Object() constructor which is called first in the hierarchy when you create an object.
Example:
package com.my.ok;
public class First {
}
what happens is compiler extends by default your First class to Object class
package com.my.ok;
public class First extends Object {
}
but Object class was not found in your case and you were getting this error.
This is a typical issue with JRE configuration in the java web project. Right-click on your project select "Build Path" and "Configure Build path". In the "Libraries" tab double click on "JRE System Libraries" and select workspace Default workspace. If you do not have one installed, please install it and follow the above process.
if your project is a maven project try mvn clean install command. It worked for me.
Go to buildPath and in libraries double click on JRE System Libraries and select workspace Default workspace.