MyEclipse: Cannot create project ontop of existing dir
support-rkalla - Dec 02, 2005 - 04:22 PM
Post subject: Cannot create project ontop of existing dir
i'm having the same problem as described above.
WinXP SP 2
Eclipse 3.1.1 build M20050929-0840
JDK 1.5.0_04-b05 (mixed mode)
fresh eclipse installation, no plugins, no updates
running as administrator
I just downloaded Eclipse 3.1.1, unzipped it to C:\ProgramFolder, started it, selected D:\WorkspaceFolder as Workspace. D:\WorkspaceFolder already existed and contained other folders.
In the menu I chose file>new>project, selected "Java Project", "create project from existing source", entered "D:\WorkspaceFolder\someotherfolder\another\another" (These folders already existed). Then, when i start typing a project name, eclipse states "cannot create project content in workspace".
I tried several project names, also the name of another folder under the "D:\WorkspaceFolder\someotherfolder\another\another". Created another workspace on drive c:, tried to create the project directly under D:\WorkspaceFolder. This all doesn't help.
When i select "create new project in workspace" it works fine, but i want to create from an existing file tree.
I also downloaded eclipse 3.1 but it's the same.
Also tried to find help on google, eclipse.org and in the help files, but nothing useful.
Thanks in advance for any help
support-rkalla - Dec 02, 2005 - 04:23 PM
If you have created projects in these locations in the past, the way you get them back into your workspace is to use File > Import > Existing Project. Eclipse won't let you recreate a new project ontop of an existing one.
Tanken - Dec 02, 2005 - 08:48 PM
First of all: Thanks for your reply.
I think i failed to express this correctly. The existing folder does not contain an eclipse project, just some java files. I'd like to make an eclipse project from those.
support-rkalla - Dec 02, 2005 - 09:12 PM
Ahh, the reason you can't do this is because your directory already lives under your workspace dir.
When Eclipse creates a new project, it automatically creates a folder under the Workspace dir with that name and sets it all up. The problem here is that you alread *have* a directory with that name so Eclipse refuses to create the project.
I realize that the behavior you want is for Eclipse to "overlay" it's project files onto the existing dir, but it won't (it plays it safe). The reason most folks likely don't run into this is because their projects exist in a source control system, so they can check out the soruce code directly into a project. In your case, I would suggest moving all the non-projects out of your workspace, and then after creating your project for them in Eclipse, dragging and dropping the project contents into the new project. From that point forrward these projects can be pulled into your workspace using File > Import > Existing Project, now that they are Eclipse projects.
Hope that helps.
Tanken - Dec 03, 2005 - 12:36 AM
What i don't understand is: There are two options in the "create new project"-window. One is "create a new project in the workspace". The other is "create a project from existing source". This sounds to me like exaktly what I want to do. I have used eclipse before on a linux machine and i think (not perfectly sure) i have done something like this and there was no problem. I'll try it on the linux machine again.
For now I'll just stick with your advice and create a new project to import the existing stuff one by one.
allelopath - Jan 15, 2006 - 08:24 PM
Tanken...I agree with you...that option describes exactly what I want to do.
I finally got sick of creating the project and then copy source over that I googled to find the 'real solution and found this thread, but apparenty it is the only thing to do.
bigcmos - Mar 21, 2006 - 05:48 PM
I found this to be a pain as well as I have a root directory which is my workspace and multiple sub directories for all of my projects. The easiest workaround I found, which is what I wish Eclipse did is to copy a .project file from another project directory I already have and copy it over to the base directory of the new project I am trying to create. I then modify the .project file to be the name of the project and remove all of the other junk in it. After doing this you should beable to import the project without haveing to muck with moving all of the source files.
Good Luck and lets hope this gets fixed in later versions of Eclipse.
patelsameerm - Jul 27, 2007 - 05:31 PM
Hi..! I was having the same problem.
Finally i came with simple solution.
Follow the steps:
1) Close your Eclipse
2) Double Click it to re-open.
3) When it asks you for WorkSpace destination, change it to the folder to which you want to create new project.
for example, i want to create new project named 'pwMgr' and my existing folder is at "D:/TP_Projects/pwMgr". So when eclipse will restart, I will change the workspace to "D:/TP_Projects/pwMgr". Then you select" File-> New Project->Java Project->" and select "Create project with Existing". Browse to your folder name and then give the same name as a project name. It will create you the same you wanted.
Try it and let me know.
Questions or Concerns, Please let me know.
juan-eclipse - Nov 20, 2010 - 08:34 AM
Post subject: There is a way
I think this a case of misleading interface design. You can create a project from existing source files located in a subfolder of htdocs (or www or other, depending on the server you are using) this way:
1. Start Eclipse and select htdocs (or www or other) as workspace.
2. Select File -> New --> Project --> PHP Project
3. Type the name of the folder that contains the source files into the Project Name field.
(Note I have not tried this with folders that are hidden deep within the folder hierarchy)
4. Choose "Create new project in workspace".
Do not choose "Create project at existing location (from existing source".
The following text is displayed: "The specified external location already exists.If a project is created in this location, the wizard will automatically try to detect existing sources and configure the buildpath appropriately."
5. Click Finish.
The project should now have been created with your source files inside. I am not sure why the "Create project at existing location (from existing source" does not do this, but that is the way it works as of today.
All times are GMT - 6 Hours
Powered by PNphpBB2
© 2003-2004 The PNphpBB GroupCredits