0

What is a "safe" way to share an Eclipse workspace between two computers? I've had problems using Dropbox and I've had problems using Github. I am looking for a best practice that will "just work".

Update

I read below and many other places that sharing a workspace doesn't work. But my collection includes 50 projects, are you saying that I need to create 50 github repos? There's no way to put them all in one repo to save the repetition?

Solution (imperfect, but still improving)

My collection of projects is in a github repo called projects/ which includes 50 subdirectories, each structured appropriately as they would be for an eclipse project.The /projects directory doesn't have meta-data or any other eclipse info (AFAIK)

Separately, in ~ I create a brand new Eclipse workspace. And then I "manually" import each one with Eclipse. I do this on each machine that needs to access those projects via Eclipse.

pitosalas
  • 10,286
  • 12
  • 72
  • 120

2 Answers2

1

No, the workspace will contain machine-specific information and locations. Share the projects themselves, preferably through a source code management system like git. If anything in the project refers to something outside the workspace, you'll want it changed to refer to that resource in a portable way (e.g. pick the JRE using an Execution Environment instead by name).

nitind
  • 19,089
  • 4
  • 34
  • 43
  • I've updated my question above accordingly. Am I now on the right track? – pitosalas Jan 22 '19 at 22:37
  • 1
    You can put all of the projects in a single repo, just not the workspace itself. It's not that uncommon; https://github.com/cloudbees/cloudbees-eclipse is all projects, but not a workspace. The Git Repositories view can be used to import them after you clone the repo. – nitind Jan 22 '19 at 22:39
  • One follow up. I have all my projects now in their own parent directory (which will goto git). I have delted .meta-data from that parent so AFAIK there is no eclipse specific stuff. Now I create a brand new workspace based in ~ so there's no old Eclipse there either. Yet, when import all the project directories, only a subset are recognized as projects and imported. Any idea? – pitosalas Jan 23 '19 at 02:07
  • Eclipse recognizes projects because of the .project file--were they all committed to the branch? If they're Maven projects, it's the one time to use the Maven project importer instead. – nitind Jan 23 '19 at 05:05
1

Look at the thread at https://stackoverflow.com/a/37799711/10235188. They describe how to share a workspace and configurations between machines. Otherwise you'll always have problems with absolute paths.

nitind
  • 19,089
  • 4
  • 34
  • 43
Frederic
  • 36
  • 2