tags:

views:

74

answers:

3

ARGH Eclipse is SO frustrating

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

BUT

If I right click on my project and go "Build Path..." -> "Link Source" and try to add it it tells me "Folder already exists with a different case". Yes i KNOW that the folder already exists THATS WHY IM TRYING TO ADD IT.

+1  A: 

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.
VonC
Almost worked. I did that and hit refresh. Now i get an error "XML format error in .classpath file of project 'xxx': Bad format'
evilfred
If you correctly added it, there should be a corresponding entry in the `.project` file as well. Sometimes when you link a folder and then remove it the link still exists. Look at your project and see if it is still there.
nevets1219
@evilfred: might be some quotes or '`>`' missing, or a unix-eol-style saved with a windows-eol-style.
VonC
Ah ok. I took it out of the .classpath, hit Refresh, then I was able to "Add Folder" it. This isn't exactly intuitive.
evilfred
+2  A: 

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.

Greg Adamski
+1  A: 

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.

nevets1219
Thank you that makes sense. I just wish that Eclipse had a more intuitive GUI :)
evilfred
I personally think NetBean's interface is pretty good. Much of the configuration available there is much more intuitive (you can also import Eclipse project). However, debugging on their isn't quite as friendly as it is on Eclipse, hence why I still use Eclipse. In addition the "project scanning" feature of Netbeans is still a work in progress.
nevets1219