Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share Eclipse configuration over different workspaces

People also ask

How do I copy an Eclipse configuration?

To use this feature, first open the workspace that contains your customised layout. Then select File > Switch Workspace > Other… which will open a dialog prompting you for an existing/new workspace. Select the workspace, then click the Copy Settings collapsible section.

Can you have multiple Eclipse workspaces?

You can't make one Eclipse process work with two different workspaces; it's just not possible. You should launch two different Eclipse processes and open a different workspace in each; one workspace can't be used by two different Eclipse processes either.

Can I share my Eclipse workspace?

A workspace is for each developer, but all workspaces can share the same projects. To simplify you can export/import project sets which will quickly setup a new workspace with the required projects.

How do I sync my Eclipse settings?

Use Navigate -> Open Setup -> User and click on the "Capture Preferences" toolbar button. This shows all instance scoped preferences and you can selectively choose which ones you want to capture as a preference task in the user. setup. Then you should be able to synchronize those with your account as well.


Sharing eclipse specific settings across workspaces:

  1. Go to ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings
  2. Copy everything under the above directory to ${new_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings

This is going to make sure that the ${new_workspace} is having the same configuration as the ${old_workspace}

Hope this helps. Update in case of any issues.


Another option is export/import:

  1. From your existing workspace, File->Export...->General->Preferences, check Export all, and choose file to save them to (prefs.epf for example)
  2. Startup Eclipse in a new workspace, File->Import...->General->Preferences , choose your file (prefs.epf), check import all

That worked great for the original author of this tip: he had his code formatting, code style, svn repos, jres preferences imported.

Edit: On Eclipse Juno this works poorly. Some preferences silently do not carry over such as save actions.


It's a relatively new project, but it looks like Eclipse Oomph was created for exactly this reason. Through this tool you can create a unique configuration that can be shared with others. I have not used it (yet), but am planning to:

https://projects.eclipse.org/projects/tools.oomph


I had to work on multiple workspaces simultaneously and there were a lot of preferences to be set each time I create a new workspace. I created a template workspace and created all the the required settings in that template workspace.Whenever I create a new workspace, I create a simlink of the {new_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings to point to {template_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings. So, when you edit any preference in any of the workspaces, it will be replicated across all other workspaces.

I created this function alias in my .profile so that once I create a new workspace, I run this function in my command prompt with my new workspace name as argument so that the link is created.

function eclset(){
    present_dir=`pwd`;
    cd  {parent_to_workspace}/$1/.metadata/.plugins/org.eclipse.core.runtime ; 
    rm -rf .settings ; 
    ln -s {parent_to_workspace}/template/.metadata/.plugins/org.eclipse.core.runtime/.settings .settings;
    cd $present_dir;
}