Eclipse and copying workspaces - eclipse

What do I have to do to copy a complete workspace from one computer to another and be simply able to continue working on it on the other computer?

In general, a filesystem copy should be sufficient. If you run into problems with your projects, try removing the project from the workspace (without deleting the files) and then re-add the project, which will rebuild the metadata.

Make sure you shut down eclipse before you copy the workspace, and that the target computer has the same (or higher) eclipse version, including the same plugins.
Check that your workspace actually contains all the projects - when creating a project, it's possible to have its files situated outside the workspace.
If your projects use any external libraries installed on the system, install these on the other system in the same place (or adjust the paths).
Then, there should be no problem.

You shouldn't have any issues with a straight filesystem copy as long as your eclipse versions match up.
If they don't, the project metadata may not load correctly

You need to copy the whole folder which you select as your workspace at startup (or you once selected). All settings are included in there (even the opened files).

I use rsync for this. Works great.

Related

Duplicate Eclipse workspace with projects

I just want to know if there is a way to duplicate an eclipse workspace including the projects inside.
EDIT : Copying files doesn't work for me, I'm looking for an automated process or a plugin.
I am not aware of any automated solution. The worskpace itself (in the .metadata directory) contains absolute paths and that's the reason why you cannot simply copy it.
I always duplicate workspace by creating a new one. It may be more complicated, but it always works. I have all the eclipse-project files (.settings directory) in a versioning system which makes creating brand new workspace relatively simple. After creating empty workspace, I just use Import -> Existing Projects into Workspace.
Not exactly copying a workspace, but you mentioned what you are looking for is an automated process, so Eclipse Installer (a.k.a. Oomph) might be an option. It allows you to provision developer workspaces including cloning VCS repositories, setting up projects and pre-setting user preferences. The Eclipse Launcher by Yatta, which extends Oomph, might also be interesting to you.
Yes if your eclipse versions match up. You can do it by straight filesystem copy. If its not same then metadata may create loading issue.

Update: Eclipse and one drive

I have a desktop and a laptop which i bring to uni. Is there a way to put eclipse workspace on One Drive (sky drive) and then be able to work on it from multiple computers? I have tried it but it seems to mess up the folders. I.e. the package folder is now a standard folder.
UPDATE:
I found this link but I'm not too sure it will work. Anyone willing to explain if this will work?
Here's the link: http://www.howtogeek.com/174765/how-to-sync-any-folder-with-skydrive-on-windows-8.1/
If you want to store the workspace there, you need to make sure that the project files such as .project and .classpath, which are automatically generated by Eclipse, are also stored. Otherwise, Eclipse won't recognize the folders as project directories.
Still even if you store all files you can encounter problems in some cases if you're using different versions of Eclipse across different computers, and with different plugins, features and so on. A simple solution is to also store the Eclipse installation itself so that you use the same Eclipse across all computers.
OneDrive does not (yet!) support syncing files that start with periods, like the .eclipse settings folders. Because of this you will not see those items sync over OneDrive.
Make NEW FOLDER in onedrive. Then run Eclipse with this folder. Run Eclipse with this folder in another computer.

How to access the same eclipse workspaces from different OSs?

I have couple of different OSs installed. When I try to start eclipse in another OS eclipse starts complaining about workspace being used by 'another eclipse instance'. In case you don't know eclipse uses .lock files for that.
How to fix this?
I see a couple of possible ways to deal with this problem:
Disable .lock file check (It can cause some problems if opening workspace in 2 eclipses at the same time)
To make an empty 'workspace' just to make eclipse happy about all that settings and .metadata and .locks and keep projects elsewhere.
Removing .lock file every time I boot another OS. But what if I'll make a new workspace?
Is there a standard (or just better) solution of this problem?
If you exited Eclipse cleanly, then it should not complain about the Workspace being used.
Or do you want to access a Workspace with multiple Eclipses simultaneously?
UPDATE: Anyway I did this on a Mac, using the same Workspace on a FAT32 partition from OSX, Ubuntu and Windows, and I didn't encounter many problems. Of course remember to set the file encoding and line termination setting project or Workspace wide!
Eclipse workspaces are not designed or intended to be shared across different machines (nor across different operating systems). Trying to do so is certain to cause headaches and possibly even corruption of the workspace. There are things like absolute file paths (and other artifacts) embedded into workspaces that simply are not portable.
The better approach is to locate the projects elsewhere in the file system outside of the workspace; that way you can have multiple workspaces "contain" the project(s). Creating such a project is easy from the project creation wizards (a checkbox labeled like "Use default location" that needs to be un-checked, and an accompanying field that is filled in with the desired files system location). From another workspace, use File > Import > Existing Project Into Workspace to get the project in.

How to delete Eclipse completely (including settings and plugins) from Mac OS X?

My Eclipse with GAE broken and works strangely.
So I deleted Eclipse from Application folder, but there is garbage left. I re-downloaded fresh new eclipse, but it runs with old settings, and broken GAE structure remained.
How can I DELETE completely Eclipse from my Mac? (without any kind of settings/plugins/logs etc.)
Eclipse itself will be installed where you've unzipped the file you've downloaded. This directory contains Eclipse.app, configuration/, plugins/ and features/ (amongst others).
Your workspace/ directory (in your home directory by default) contains all your projects and various settings too, in workspace/.metadata/ (see dot files if you want to have a look). Deleting the workspace will delete your own project files of course, so you would need to make sure you have a way to restore them from a clean version (for example from a version control system if you're using one).
If you don't want to delete your entire workspace, it might be worth moving it away and then copying the projects back in, leaving the new workspace/.metadata/ clean, to see if this fixes your problem.
Add ~/Library/Caches/org.eclipse.platform.ide to the list
Im not sure if this is the right place for such kind of questions...But r u using any applications such as "app cleaner"?
if not try it... http://en.softonic.com/s/app-remover:mac

Sharing Eclipse directory on Dropbox between Windows and Mac OS X

This question was close to mine, but not quite.
I have a Windows desktop and a MacBook Pro. I'd like to be able to keep my Eclipse workspace in my Dropbox folder. The problem is that many project settings change between platforms: references to JREs, JDKs, and other libs.
Every discussion I've seen of this problem seems to suggest taking advantage of the source control system's ignore functionality, so that such-and-such file remains local-only and thus able to remain platform-specific. But when you're working with a real single shared folder, that class of solution doesn't apply.
Have you had luck working with a Java Eclipse project living in a single folder shared over the network, cross-platform?
I have my Eclipse workspace inside Dropbox with all my project folders within, but use the new-ish "Selective Sync" feature of Dropbox to make sure that the .metadata folder is not synced.
This means my Mac and Windows machines have their own .metadata folders but the project folders remain in sync.
Seems to be working so far...
Use source control with individual workspaces. By doing it this way you lose the capability of two developers making changes to the same file. You also run a higher risk of people stepping on each other. With Subversion (or others) source control is free and gives you traceability.
Perhaps the way to have less problems is just to share the source folder, neither workspace settings nor bin folder.
Just put your source folder in Dropbox.
Create the project on site1 and then:
Right click over the project, choose properties
--> Java Build path --> Source tab
--> Link source button
Then create a link to your source folder in Dropbox and assign it a name (e.g. src2)
Make the same for site2.
All your source files must be in your share source folder in Dropbox.
Of course you must configure on each site the settings like libraries and other stuff but this task is less frequently and perhaps desirable because you have two different environments.
For anyone else having trouble getting this to work, try File->Import->General->File System. Be sure to select Create links in workspace from the Advanced options. Seems like the cleaner solution and you can keep using your usual workspace.