Home > Enterprise >  Why Is My Eclipse Java Program Not Running - Error Message: "Error: Could not find or load main
Why Is My Eclipse Java Program Not Running - Error Message: "Error: Could not find or load main

Time:10-12

I am working on a Java project for a Computer Science class. For this class, I downloaded a zip file and imported it into Eclipse to then start working on it. Before I could even start writing code I had error messages which had never happened before when importing zip files and opening them up.

The first error message I came across was: "Linkage Error occurred while loading the main class", along with other side errors like, "Must define an explicit constructor".

I attempted to do some research and the only thing I could find was setting my JDK settings back to an earlier version. I went in and changed my compiler from JDK 15 to JDK 11 and attempted to run the code once again. Now instead of Linkage Error, it gives the error message which can be seen in the screenshot provided below:

Adding a Library Picking a JRE by Execution environment

  • Related