To change a default Eclipse project to an Eclipse Java project you can follow the steps below.
- First close the project in Eclipse (right-click project folder > close project)
- Open the .project file in a text-editor outside Eclipse
- Add the Java builder and nature to the .project file
- Save and close file
- 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>