Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single Eclipse install with multiple Configurations and Workspaces

Been trying to get this figured out for a few days, so please don't flag as a duplicate.

What I want is the following:

  1. One Eclipse installation, i.e. Eclipse-3.7-64bit-RCP
  2. Multiple "configurations" that use (1) to run, i.e.:

    • Python configuration with plugins like PyDev
    • Scala configuration with plugins like ScalaIDE
  3. Multiple workspaces, like:

    • UI (will use /ui workspace and Python configuration)
    • Logic (will use /logic workspace and Scala configuration plugins)

So what you have in the end are just two shortcuts:

  • UI:

    [path-to-installation]/eclipse -configuration [path-to-config]/Python 
    -data [path-to-workspace]/ui
    
  • Logic:

    [path-to-installation]/eclipse -configuration [path-to-config]/Scala 
    -data [path-to-workspace]/logic
    

The problem is, "configuration" parameter is not behaving as I supposed it would. It seems its doing some kind of "shared" configuration area of some sort... in a sense that the directory [path-to-config] is actually being populated with folders like p2, plugins etc...

Whereas one would think that [path-to-config] would only contain subfolders python and scala.

like image 709
Andriy Drozdyuk Avatar asked Nov 08 '11 16:11

Andriy Drozdyuk


People also ask

How do I use multiple workspaces in Eclipse?

To open multiple Eclipse windows using the same workspace, select Window→ New Window. It's a good idea to use this technique if you want to work in two different perspectives (such as the Java and Debug perspectives) at the same time in different windows.

Can I have two different Eclipse installed?

You can install each Eclipse version in a different location and then run them as you wish. Note that install here means download the zip file from the eclipse.org web site and unzip it to the location you want.

How do I copy a workspace from one Eclipse to another?

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 we install multiple Eclipse on Windows 10?

Yes you can have multiple installs.


2 Answers

Ok, so I've figured this out. It is a little confusing, but stick with me here. The key is to have a subdirectory inside your config directory.

So instead of simply defining an Eclipse shortcut with a configuration parameter like this:

-configuration [path-to-config]/Python 
-configuration [path-to-config]/Scala

one must create a further "subdirectory" inside Python or Scala configuration directories respectively. Any directory name will suffice, I use config:

-configuration [path-to-config]/Python/config
-configuration [path-to-config]/Scala/config

I suspect this might have something to do with parent directory of the configuration being used to store some kind of shared configuration. By defining an extra subdirectory we are probably preventing Eclipse from knowing about the other configuration altogether.

In any case, if you define your -configuration as above, each Eclipse started will have it's own set of plugins.

So, as an example these two shortcuts:

[path-to-installation]/eclipse -configuration [path-to-config]/Python/config 
-data [path-to-workspace]/ui

[path-to-installation]/eclipse -configuration [path-to-config]/Scala/config 
-data [path-to-workspace]/logic

launch the same Eclipse installation, with completely different, indepenent sets of plugins, and use different workspaces.

like image 102
Andriy Drozdyuk Avatar answered Oct 19 '22 13:10

Andriy Drozdyuk


The configuration directory contains the runtime-install information of the current eclipse. But by default there is usually a p2/ directory at the same level as the configuration directory, which contains p2 profile information and the plugin version lineups. On top of that, the base eclipse install (the bundle pool) is in plugins/ and features/ directories at the same level as p2/ by default.

With p2 doing the underlying provisioning, you can do things like create a shared bundle pool (with all the plugins) but still create separate configuration directories and p2 profiles to controls which plugins are launched. But it sounds like you want the extra plugins (like scala and python) in their own separate directories, not in the common bundle pool.

You will have to investigate the mysteries of p2 if you want to create a layout like that. A good starting point:

  • p2 director
  • blog: Multiple Architecture, Single Build
  • blog: Adventures in Multi-Architecture Eclipse
  • Bug 342156 - p2 director ignored bundlepool when using -roaming
like image 43
Paul Webster Avatar answered Oct 19 '22 12:10

Paul Webster