Overview
Here is the situation. You created your project from Github first and then pull that project into Eclipse. It is now a Default project, not a Java project. When you add a Java class in your project, it shows the error Source folder is not a Java project. What you have to do is to change your Default project to a Java project. Don't manually change the XML files, e.g. .project
and .classpath
. It is dangerous. Eclipse provides the UI to do this.
Change project nature to Java using Eclipse UI
- Right-click on your project folder.
- Select Properties.
- Select Project Natures and then Add Java.
- Note: Click on Apply and Close. Otherwise, the other options will not be shown.
- Go back to the project Properties.
- Navigate to Java Build Path->Order and Export and then check JRE System Library.
- From Java Compiler, check Enable project specific settings