Eclipse - Change to Java project

By xngo on February 20, 2019


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

  1. Right-click on your project folder.
  2. Select Properties.
  3. Select Project Natures and then Add Java.
  4. Note: Click on Apply and Close. Otherwise, the other options will not be shown.
  5. Go back to the project Properties.
  6. Navigate to Java Build Path->Order and Export and then check JRE System Library.
  7. From Java Compiler, check Enable project specific settings

Change to Java project

About the author

Xuan Ngo is the founder of He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.