Issue
I am using Eclipse.
2 folders: src/test and src/main
Both have a package with same name: Academy
.
The Academy
package in src/test has in it a class name: Base.java
The Academy
package in src/main has in it a class name: HomePage.java
In the HomePage.java class, extends Base
is not detecting base class in it.
This is the code inside HomePage.java
package Academy;
import Academy.Base;
public class HomePage extends Base{
}
There is a red line on Academy.Base
and on Base
. It tells to make Base
class, but it is already there. I tried to save the file. I tried to make new project too. Please Help. Thank you.
Here is the reference image:
Solution
Solved the above error by following these steps:
Right click on project->Build path->Configure build path->source tab
then search tab search under your project src/main/java
and change "contains test sources" from No to Yes and apply the changes
Answered By - Jay Shah
Answer Checked By - David Marino (JavaFixing Volunteer)