Howto change a default Eclipse project to an Eclipse Java project

To change a default Eclipse project to an Eclipse Java project you can follow the steps below.

  1. First close the project in Eclipse (right-click project folder > close project)
  2. Open the .project file in a text-editor outside Eclipse
  3. Add the Java builder and nature to the .project file
  4. Save and close file
  5. Open project in Eclipse and it now is a Java project

Example:
Original .project file

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>A project</name>
	<comment></comment>
	<projects>
	</projects>
</projectDescription>

New .project file

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>A project</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>

</projectDescription>