'Cannot create project content in workspace' when trying to recreate a project
Asked Answered
Q

5

31

I created one project in Eclipse using Existing Source option. Later I found some config problem with it and deleted the project from eclipse keeping the contents of the folder untouched. Now again I tried to create a new project with the same folder as the source folder. But Eclipse is not allowing me to do it and its giving error 'Cannot create project content in workspace'. I checked in the source folder for any .PROJECT files, but none is existing. Do anyone has a solution to this ?

Quietism answered 31/1, 2012 at 7:22 Comment(0)
I
34

As described by this message on the Eclipse forums, the project location you are selecting is already in your workspace. The "create from existing" feature needs to have the source located outside the workspace. You need to either move the source out of the workspace or create a New project giving the folder containing the project as the project name.

Indigent answered 1/2, 2012 at 4:26 Comment(1)
It has been years and Eclipse still has the same issue. IntelliJ provides much better user experience than Eclipse.Sentimentality
W
7

This is mainly an issue when trying to create a project in a nested sub folder of the workspace. If the project is in a direct sub folder of the workspace folder, just create a new project, use the folder's name as project name and everything will behave like you want to. Otherwise, I used these two solutions without any issue yet, but I think this may depend on which type of project you create (I use mainly pydev, CDT and DLTK):

  • Make a link to the project outside of the workspace directory and import that link. Eclipse does not complain and you can reduce the 'outside' resources to a few symbolic links.
  • Create a new stub project, copy all relevant project files (e.g. .buildpath, .project, ...) to the actual project folder. Then delete this stub project and import the other project, which now works. Note that importing is not the same as new>create from existing, it's really a separate import option.
Walkout answered 27/8, 2012 at 12:11 Comment(2)
the second one is the only method to create a project in a subfolder... years to find this answer. The Eclipse error message is far away to be clear.Cowhide
The second one was very helpful especially when my project was already committed to git and I don't want to move it into a separate directory.Decomposition
P
5

I had a similar problem. I was creating a PHP project in eclipse, in a workspace that has other projects, and for some reason was not able to create it (I think because it is in a sub folder and not in the root folder of the workspace). In anycase, what I ended up doing is the following:

  1. In Eclise, create a new project in the root folder of your work space

  2. Still in Eclipse, after the project is created, right click and delete the project, but make sure you do not select the option to delete the files on disk (i.e., keep the files/folders on disk)

  3. Go to your Windows Explorer, and move the project to the location you like to place it at (ie., the location you could not use in the first place).

  4. Back to Eclipse, and this time import the project (impot -> existing project into workspace) and you will have your project there.

Penury answered 24/5, 2013 at 22:8 Comment(0)
S
3

I had the same issue and here is how i solved it:

1. moved the project folder(named www) outside the workspace folder
2. created new project in the workspace with the same name(www)
3. close eclipse
4. move the external www folder into the workspace folder (e.g. overwrite the new one created within eclipse)
5. open eclipse
6. F5/refresh on the www folder inside the workspace 

et voila.

Schoen answered 8/2, 2014 at 8:7 Comment(1)
You don't need to close Eclipse. You can simply copy (and replace) the contents of the original project to the new project, and then refresh in Eclipse.Compaction
F
-1

it works for me: file->import->projects from file system or archive->directory->be happy

Fraya answered 16/8, 2019 at 19:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.