Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse changing workspace and directory

I am not that used to changing workspaces in Eclipse, in fact, I only have one workspace. But right now, there is a need to change workspace and organize different projects but I don't know how to do it.

I saw something about refactoring and simply importing projects but I don't want the outcome of that.

Currently, I 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 that workspace I imported some projects from the prevoius workspace. Yes I already see the projects in the dev workspace but when I open the other workspace (C:) I still see the imported projects and the folder (C:...\workspace) still contains the projects. What I want to do is to transfer the projects in a different workspace and in a different folder, which in my case D:\dev.

I tried to refactor but it says that it overlaps with the workspace location.

Please suggest the best way to do this.

I would also like to ask your recommendations whether I should have a same workspace and projects folder (like what I want to do) or different directories for my workspace and projects folder.

like image 997
krato Avatar asked Feb 12 '14 02:02

krato


1 Answers

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

  1. Create a new Eclipse workspace (like you have done already)
  2. Import the projects you want to move using File/Import/General/Existing Projects and select the check box "copy projects into workspace"
  3. Delete the now copied projects from the original workspace in Eclipse and select the check box "delete project contents on disk"

After that you will have completely moved the projects from one workspace to another, including the underlying folders.

I would also like to ask your recommendations whether I should have a same workspace and projects folder(like what I want to do) or different directories for my workspace and projects folder.

It depends on your own preferences and, how the projects are going to be used. I prefer to have my main project folders separate from my workspaces, because some of them will reside on either SVN, GIT or also Dropbox. Especially library projects, that might be used by more than one other projects, are better kept in a separate workspace and/or folder. This allows one to keep the overview and one can simply include these library projects in other workspaces when needed.

like image 133
Balder Avatar answered Sep 22 '22 13:09

Balder