Search code examples
eclipseworkspaceproject-settings

Eclipse - sharing workspace through dropbox (.project files error because of wrong path)


I'm sharing my eclipse workspace with my dropbox.

I have my dropbox folder at M:\Dropbox at home and at D:\Dropbox at work.

At home, I want to keep M: for "My files"-Drive and don't want to change that to D: and at work, M: is already mapped...

Is there another way than making symbolic links to a location I can use on both machines? My goal is, that I don't have to change anything on my home computer...

Another problem is, that I'm using a variable and relativ paths to this variable for importing libraries. So I just have to change the single variable, if the path changes.

Is there a way to solve this problem?


Solution

  • Maybe just remap M: to something else at work and then map D: to M:

    Edit: otherwise check out this link http://www.eclipse.org/forums/index.php/t/270978/

    for consistency i'll copy the important part:

    As I say, you can't share workspaces, but you might get away with sharing the same project. Here's how.

    1. Create the project on one computer, get it more or less how you'd like it (i.e.: simple Java Project, Dynamic Web Project, etc. as created by Eclipse). You'll be able to add or delete source code later, but the project should exist enough for Eclipse to recognize it.

    2. Copy the important parts of the project to your dropbox location.

    3. From inside Eclipse, discard the original project including source files (it prompts you to be cautious about this).

    4. Create a new project in the same (or a different) workspace. When the wizard comes up, you can name it what you want, but tell it to get the source files from another location and not to copy them into the workspace. Eclipse will consume the project from dropbox, I think.

    5. Repeat this from your other computer from its Eclipse using, obviously, its own workspace.

    6. The changes you make from one computer will be reflected in the other. You will have to right-click your project and choose Refresh when you change computers.

    7. All third-party libraries (JARs) must be copied to a path inside your project. Otherwise, your .classpath file will acquire full filesystem pathnames which will not hold true on both computers. Another way of causing this problem is to associate Javadoc or source code with any of those third-party JARs (let's say you wanted Javadoc for hibernate3.jar, you're screwed as soon as you do that).

    I have not done this; there may be a hole in what I'm telling you or, you may accidentally do something that destroys your ability to do it this way (as suggested by #7).

    As I pointed out in my original reply, it's better to use a version-control system for this (and, obviously, there are other benefits too).

    i think this will cover the main idea of the forum post. I myself took the solution of using a version-control system since it is a cleaner way of doing things