Eclipse: How to add an existing source folder?

No need to close Eclipse. Open .project file using Notepad++, find link to the existing source/folder and delete it. Save the file. Refresh the project in Eclipse. Now you should be able to link it again.


A screen capture might help, but if the GUI is un-cooperative, you can:

  • close Eclipse
  • open the .classpath file which defines your project (it may be located in your workspace)
  • see if you can define a new classpathentry of kind "src": this is not the easy method, but that may give you an idea why the GUI refuses to define the same entry.

For Linked Sources, you should have something like the following in your .classpath

<classpathentry kind="src" path="module_name"/>

With a corresponding matching entry (within <linkedResources>)in your .project

<link>
  <name>module_name</name>
  <type>2</type>
  <location>path/to/your/module</location>
</link>

NOTE: Removing a linked project doesn't necessarily remove it from the project.


I think all you need to do is refresh the project. Eclipse does not automatically pick up folders (or files) dropped into it's project directory.

Tags:

Eclipse