Eclipse: Error ".. overlaps the location of another project.." when trying to create new project

I keep getting an error message in Eclipse when creating a new project.

I have created a workspace at the level

C:\Users\Martin\Java\Counter

Inside Counter there are no files but there is a directory called counter_src which contains source files for the project Counter

So in Eclipse I do, New Java Project, and then uncheck default location and choose the directory

counter_src (which is one level down from Counter)

but it now displays

C:\Users\Martin\Java\Counter\counter_src overlaps the location of another project: 'counter_src'

Now if I create my workspace at

C:\Users\Martin\Java\

which means my counter_src is actually 2 levels down then it allows me, but the problem is that the directory Java contains lots of projects so I wanted to create the workspace in Counter (which has no files) which has subdirectory of counter_src where my source files are.

Also tested creating directory in C:\Users\Martin\Java\ and it appears to work also but I didn't want to create another subdirectory in "C:\Users\Martin\Java\" just to store my workspace for 1 project.


So, I was having the same issue, but trying to import Android code via the "Import..." menu. When neither of the above two solutions worked on Eclipse Juno:

  • Eclipse -> File -> Import -> General -> Existing Project Into Workspace (NOTE: NOT 'EXISTING ANDROID PROJECT')

  • (Projects should import correctly, but should have errors. We must now attach the SDK to the project)

  • Right-Click on the project, Properties->Android->Project Build Target Choose the appropriate build target (in doubt, use 4.0.3 in the project is newish, and use 2.2 if the project is oldish)

  • Click OK

Once the project rebuilds, everything should be back in order.

(This was written when Eclipse Indigo was in vogue, and there may be changes as Google updates their tools to cover corner cases.)


Eclipse is erroring because if you try and create a project on a directory that exists, Eclipse doesn't know if it's an actual project or not - so it errors, saving you from losing work!

So you have two solutions:

  1. Move the folder counter_src somewhere else, then create the project (which will create the directory), then import the source files back into the newly created counter_src.

  2. Right-click on the project explorer and import an existing project, select C:\Users\Martin\Java\Counter\ as your root directory. If Eclipse sees a project, you will be able to import it.


Your have dropped the Project in your workspace, and then trying to import it, that's the problem.

This has two solutions:

1. More your project folder outside your workspace in some other location and then try.

2. Go to File ---> new Project ---> Select the existing project radio button ---> browse to the project folder in your workspace ---> finish

Edited

Assume D:\MyDirectory\MyWorkSpace - Path of your WorkSpace

Drop your project which you want to import in Eclipse in MyDirectory folder Not in MyWorkSpace, and try.


In my case checking the check-box

"Copy project into workspace"

did the trick.


simply "CUT" project folder and move it out of workspace directory and do the following

file=>import=>(select new directory)=> mark (copy to my workspace) checkbox 

and you done !