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

戏子无情 提交于 2019-11-27 17:13:51
justderb

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.

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

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

This has 2 solution.

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

2. Go to File ---> new Project ---> Seleclt 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 !

This too took me sometime to figure out.

Solution:

To create a new Maven Project under the existing workspace, just have the "Use default Workspace location" ticked (Ignore what is in the grayed out location text input).

The name of the project will be determined by you Artifact Id in step 2 of the creation wizard.

Reasoning:

It was so confusing because in my case, because when I selected to create a new Maven Project: the default workspace loaction is ticked and directly proceeding it is the grayed out "Location" text input had the workspace location + the existing project I was looking at before choose to create a new Maven Project. (ie: Location = '[workspace path]/last looked at project')

So I unticked the default workspace location box and entered in '[workspace path]/new project', which didn't work because eclipse expects the [workspace path] to be different compared to the default path. (Otherwise we would of selected the default workspace check box).

In my case clicking the checkbox for 'import project into workspace' fixed the error, even though the project was already in the workspace folder and didn't actually get moved their by eclipse.

FWIW:

Neither of the other suggestions worked for me. I had previously created a project with the same name which I then deleted. I recreated the base source-files (using PhoneGap) - which doesn't create the "eclipse"-project. I then tried to create an Android project using existing source files, but it failed with the same error message as the original question implies.

The solution for me was to move the source-folder and files out of the workspace, and use the same option, but this time check the option for copying the files into the workspace in the wizard.

I know this is older, but wanted to contribute another possibly solution.

If you want to keep the project location, as I did, I found that copying the .project file from another project into the project's directory, then editing the .project file to name it properly, then choosing the Import Existing Projects into Workspace option worked for me.

In Windows, I used a file monitor to see what Eclipse was doing, and it was simply erroring out for some unknown reason when trying to create the .project file. So, I did that manually and it worked for me.

Go to the actual FILE menu and create a new general project.

If the project type isn't recognized, preventing one of these import methods from working, then try this. Once you add the generic project, you can then add support for whatever language you require.

I got this error when trying to create a new Eclipse project inside a newly cloned Git repo folder.

This worked for me:

1) clone the Git repo (in my case it was to a subfolder of the Eclipse default workspace)

2) create the new Eclipse project in the default workspace (one level above the cloned Git repo folder)

3) export the new Eclipse project from the default workspace to the cloned repo directory:

a) right click on project --> Export --> General --> File System
b) select the new Eclipse project
c) set the destination directory to export to (as the Git repo folder)

4) remove the Eclipse project form the workspace (because it's still the one that uses the default workspace)

right click on project and select "Delete"

5) open the exported Eclipse project from inside the Git repo directory

a) File --> Open Project from File System or Archive
b) set the "Import source" folder as the Git repo folder
c) check the project to import (that you just exported there)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!