How to move an eclipse (helios) project to a different workspace?
Asked Answered
P

2

14

First, Eclipse is not my native IDE -- I'm barely a n00b with it. I set up a project in a workspace that was actually in the directory of another client's project (I didn't really follow the whole workspace/project thing) and, in fact, now I can't even find the Eclipse workspace file to open it.

What I'd like to do is:

  • Open my eclipse project (/workspace?) -- I know where all the files are on disk, just not what to open in order to see them in Eclipse -- and

  • Move my project to a new workspace, which I guess I will put in a generic Eclipse-y place, and have that one workspace reference all my Eclipse projects.

(Is that the right way to do it? Does Eclipse dislike me being a one-project == one-workspace kind of guy?)

Please educate me regarding The Eclipse Way so that I can get back to work writing code.

Thanks!

Philbin answered 24/8, 2011 at 18:33 Comment(1)
P.S. I found my sources/workspace (sort of), in that I had moved the directory that contained the "other client"'s stuff, and that prevented Eclipse from finding my workspace. I moved it back, and now switch workspace got me back my sources, so I can continue working. I'd still like to do the 2 items in my Q, though.Philbin
N
30

Roughly a workspace (which is a directory) in Eclipse contains:

  • configuration (installed JRE, Servers runtimes, code formatting rules, ...)
  • one or more projects

You can of course have as many workspaces as you want (but only one can be opened at a time) and a project can also be part of different workspaces.

If you know where your sources are and want to move them to a new workspace here is a possible solution:

  • Start Eclipse and when prompted for a workspace choose where you want the workspace to be created (if directory doesn't exist it will be created). For example you can choose C:/Dev/Workspace/.
  • If you are not prompted, go to File->Switch workspace->Other
  • Once you are in your workspace you can import your exisiting project with File->Import then General->Existing Projects into workspace
  • Navigate to the folder containing your project sources, select your project and click finish

I don't know if it's a best practice or not but what I usually do is the following:

  • I have one workspace for each of my customer (workspace_cust1, workspace_cust2)
  • Each workspace references my commons library projects and add client specific projects

This way each time I change my commons library it's up to date in every workspace.

Narco answered 24/8, 2011 at 19:14 Comment(1)
I have several workspaces open simultaneously since years. It is officially supported.Yeomanry
S
3

If you want to apply

one workspace = one project

You could to the following:
1) Copy the eclipse desktop shorcut
2) Modify the shortcut by appending "-data workspaceLocation "

Schall answered 24/8, 2011 at 18:55 Comment(1)
There should be a space after -data, so it should be `-data workspaceLocation'Dynamo

© 2022 - 2024 — McMap. All rights reserved.