Eclipse changes workspace and directory

I'm not used to changing workspaces in Eclipse, in fact I only have one workspace. But right now it is necessary to change the workspace and organize various projects, but I do not know how to do it.

I saw something about refactoring and just imported projects, but I don't want this.

I currently have C:\Users\krato\workspace\ as my default workspace, and I want to create another in D:\dev\ . So I created one using File > Switch workspace > other > D:\dev\ . And in this workspace, I imported several projects from the prevoius workspace. Yes, I already see the projects in the dev workspace, but when I open another workspace (C :), I still see the imported projects, and the folder (C: ... \ workspace) still contains the projects. What I want to do is transfer the projects to another workspace and to another folder, which in my case is D: \ dev.

I tried to reorganize, but he says that it overlaps with the workspace location.

Please suggest a better way to do this.

I would also like to ask your recommendations whether I should have the same workspace and project folder (for example, what I want to do) or different directories for my workspace and project folders.

+8
java eclipse eclipse-juno
source share
4 answers

Project folders do not have to be in the Eclipse workspace. In fact, I would recommend keeping them separate:

  • Project folders contain project code along with Eclipse .project and .classpath .
  • Your workspace, on the other hand, contains Eclipse settings for working with your projects. It can contain several projects, and the project can be contained in several workspaces.

In your example, I would recommend manually copying or moving the code to D:\Dev , creating a new workspace in C:\Users\krato , for example. C:\Users\krato\workspace-dev , and then import your projects there, using the import of existing projects.

I would recommend moving, not copying. If you really need a second copy of your project, consider using a version control system, such as git, and create a branch instead.

+6
source share

To achieve what you want, you need to do the following:

  • Create a new Eclipse workspace (as you already did)
  • Import the projects you want to move using File / Import / General / Existing Projects and select the "copy projects to workspace" checkbox
  • Now delete the copied projects from the original workspace in Eclipse and check the "delete project contents on disk" box

After that, you completely move projects from one workspace to another, including base folders.

I would also like to ask your recommendations whether I should have the same workspace and project folder (for example, what I want to do) or different directories for my workspace and project folders.

It depends on your own preferences and how the projects will be used. I prefer my main project folders to be separated from my workspaces because some of them will be in SVN, GIT or Dropbox. Especially library projects that can be used by more than one other project are better stored in a separate workspace and / or folder. This allows you to save a review, and if necessary, you can simply include these library projects in other workspaces.

+5
source share

If you have not deleted projects from the first workspace, they will still be there. Have you copied files from C: to D: or move them? If you copied them to D: and you do not want them in C :, remove them from C :. But make sure they really are on D: first.

Or am I completely misinterpreting your question?

0
source share

I believe I had a problem with this, and she conquered it.

I needed to move the entire workspace (containing my project directories) to another drive in Windows. If you want to move only some projects and keep the old workspace, this could be changed simply by deleting the projects as you wish.

On http://www.eclipse.org/forums/index.php/t/248863/ nwbeeson wrote:

Thanks. Here's how to do it from a friend who is an Eclipse Expert. 1. Open Eclipse and switch to Workspace1 using Switch To Workspace ... 2. Check the projects in Workspace1 3. Switch to another workspace to make sure that Workspace1 is completely closed by Eclipse (critical step!) 4. Close Eclipse 5. Copy Workspace1 and name the copy Workspace2 6. Copy Workspace2 to the USB drive 7. Copy Workspace2 from the USB drive to the hard drive of another computer 8. Open Eclipse on the new computer. 9. Switch to Workspace2 using the switch to workspace ...

Projects usually opened from Eclipse on any computer, as if this workspace was there all the time. It seems like a critical step is switching to another workspace before exiting Eclipse. If you skip this step, the copied and migrated workspace is not copied correctly.

It worked perfectly. Without a critical step, Eclipse abandoned a new place in the workspace. All kinds of links to old paths are used and, apparently, are updated only if the workspace was completely twice hyperbolically closed before copying the workspace to a new location.

0
source share

All Articles