Convert an Eclipse “General” Project to a Java Project

Link

I don’t know how many times I’ve accidentally created a General project instead of a Java project, and it always bugged me that you couldn’t convert from General to Java without starting over.

The quick and easy hack is explained well here. Open the relevant .project file and add the following (note that you don’t need the element if one is already there):

<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>

It’s too bad you can’t “Add Java Project Nature” from within the Eclipse UI

Make sure you do this with the project closed!