Eclipse: How to add an existing source folder?

I have a c: \ RemoteSrc directory. There are 3 directories in this that are currently the source folders (I think the icon is an open folder with a small orange grid in it) in my Eclipse project. I dropped the new directory under c: \ RemoteSrc, which I also want to add to my project.

BUT

If I right-click on my project and go to "Build path ..." → "Source of links" and try adding it, it will tell me that "The folder already exists with another case." Yes, I KNOW that the folder already exists. WHY WE TRY TO ADD THIS.

+54
eclipse
May 14 '10 at 23:22
source share
5 answers

I think all you have to do is update the project. Eclipse does not automatically pick up folders (or files) that have fallen into the project directory.

+51
May 14, '10 at 23:30
source share
— -

Screen capture can help, but if the GUI is incompatible, you can:

  • close eclipse
  • open the .classpath file that defines your project (it may be located in your workspace).
  • see if you can define a new classpathentry form " src ": this is not a simple method, but it can give you an idea of ​​why the GUI refuses to define the same entry.
+5
May 14, '10 at 23:29
source share

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

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

With corresponding matching entry (inside <linkedResources> ) in .project

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

NOTE. Removing a linked project does not necessarily remove it from the project.

+5
May 14 '10 at 23:36
source share

I had a problem when I created the / src directory in my working directory and then wanted to link another directory with additional files to import. The "existing directory" was because the directory I was trying to link was also called "/ src", although the path was different. I think Eclipse cannot have directories with two / src in the same project, like trying to mount two file systems in the same node. I rebuilt the directories, so there was only one / src, and everything was fine.

0
Mar 12 '13 at 14:09
source share

There were times when I tried to update my project, which led to the creation of several .classpath files. SO deleting the copies and returning the last .classpath file and then updating / rebuilding the project solved the problem for me.

Hope this helps!

0
Sep 12 '16 at 6:00
source share



All Articles