Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 842
Martin Avatar asked Jul 31 '12 04:07

Martin


People also ask

Can I move Eclipse workspace to another folder?

Close Eclipse. Open the location of the workspace and cut paste the entire directory (which contains the ". metadata" directory into the intended location. Restart Eclipse with newly copied folder as the workspace (parent directory of ".


2 Answers

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.)

like image 83
Eagle Avatar answered Oct 03 '22 07:10

Eagle


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.

like image 41
justderb Avatar answered Oct 03 '22 08:10

justderb