views:

94

answers:

1

When I do File -> Import, General (from the pop-up window)->Existing Projects into Workspace, I can browse to where all my projects are and import them so my Eclipse workspace folder with its .metadata is in a separate location from my source directory.

The problem is, if I add a new project or even add a new file within an existent project, the new files get made in my Eclipse workspace folder, not over where the other code lives.

How do I tell Eclipse to put new code in the source directory, not in the workspace directory? When importing, I did not check the checkboxes "Copy projects into workspace" or "Add project to working sets" (Add project to working sets requires the selection of working sets, which I don't know about).

Thanks!

+1  A: 

It depends on the kind of project you are creating. For example, a "Project" type project that just contains dumb files lets you uncheck the "Use default location" option and will actually be created in whatever directory you give it.

Java projects, on the other hand force you to create them in the workspace.

For project types that eclipse will only create in the workspace you can use the following workaround.

  1. Create the project in your workspace.
  2. Delete the project from eclipse without deleting the files on disk.
  3. Use your OS tools to move the project folder where you want it.
  4. Back in eclipse: File -> Import -> Existing Projects into Workspace
  5. Browse to folder containing your relocated project.
  6. Make sure to uncheck the "Copy projects into workspace" option
ChrisH
That makes perfect sense, thanks! I think that's a definite area where Eclipse could improve (not forcing new projects to be in the workspace).
Pete