开发者

Importing projects with Eclipse so new stuff I add will go to the source directory as well

开发者 https://www.devze.com 2022-12-22 09:39 出处:网络
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 .metadat

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 开发者_StackOverflowI don't know about).


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
0

精彩评论

暂无评论...
验证码 换一张
取 消