Dec 05

Quick Tip: Convert an Eclipse “General” Project to a Java Project

Tag: eclipse, javapmularien @ 6:57 am

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 <natures> 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!

5 Responses to “Quick Tip: Convert an Eclipse “General” Project to a Java Project”

  1. noon says:

    If you’re using Maven2, you can add Eclipse natures in Maven2 eclipse-plugin settings :)

  2. noon says:

    If you’re using maven2, you can add Eclipse natures in Maven2 Eclipse plugin settings.

  3. Marcos Silva Pereira says:

    I do that without restarting Eclipse.

    +1 for the lack of “add java nature”.

    Kind Regards

  4. Marcos Silva Pereira says:

    Hum, there is an issue for that:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=102527

  5. Mike Dalsey says:

    This informations was tremendously helpful to me. Thank you.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>