Two eclipse installations with completely separate development environments - eclipse

I am an Eclipse newbie (on Windows 7). Is it possible to have two Eclipse installations at the same time where one is customized for Python development (via PyDev), and the other for embedded C development (through GNU toolchains)? If so, how would one go about doing this? If one of the Eclipse environments is already installed, what should I pay attention to when installing the second environment? (Or is there another, completely different approach that only uses one copy of Eclipse, but multiple plug-ins? Just thinking out loud here.)
I am apprehensive of things (plugins, workspaces, environment variables, etc.) getting mixed up.

Just install the second Eclipse in a separate directory and use separate workspaces and there should not be any problem. Eclipse keeps all the configuration information about the installation in its install directory. All information about a workspace is kept in the workspace.

Get the zip-version of eclipse, unzip it into two different folders, and create a separate workspace for each of them. Then install plug ins etc.. This works on Linux; I don't see why it shouldn't work on Windows.

Related

multiple copies of eclipse in different locations

I want to use eclipse on multiple projects simultaneously located in different workspaces. so I intend to extract the installation archive to different locations and run eclipse.exe in each at the same time.
the question: I am expecting bugs or any kind of unwanted interference?
You would only use different instances of eclipse if your projects needs different tooling (plugins) and you don't want to clutter interface installing all tools together (for example you could have one for spring projects, one jboss tooling, one for python, one for android projects), but I would probably still install a couple of tools together.
In most cases using one instance is enough and that's what I use (I just choose a workspace I want to work with on eclipse start, but the other option could be to use -data in the shortcut to specify the workspace location that should be used).
[You can modify the list of recent workspaces by editing eclipse/configuration/.settings/org.eclipse.ui.ide.prefs file]
Having one instance could save you time when you update or install new tools (they will automatically be avaliable with all your workspaces).
One common problem here is sharing the preferences between workspaces. (Preferences are stored per workspace). I use one empty workspace with all my favourite settings as a template and just copy ".metadata" folder to every new workspace I create.

Can different IDE share a same workspace?

I would like to use Eclipse and Spring Tool Suite at the same time using the same workspace.
Is there a way to do that?
PS: I've tried deleting .lock file in .metadata directory. But after I open Eclipse again, it's regenerated.
Thanks in advance!
No, it is not possible. The workspace stores several piece of information that both IDEs require (e.g. the Eclipse file system model that stores the list of all projects).
There are two things you could do (if you really require to work with both components):
Install every plug-in of one of your IDEs into the other (presumably it would be easier to install your Eclipse plug-ins into STS, but it very much depends on what you have installed). Then, if you need, you can open two windows (Window / New Window from the main menu), and then manage your stuff as needed.
Maintain two installations with two different workspaces, that share a set of projects stored outside the workspace. However, I would not recommend this approach because
You have to refresh the projects in the other workspace (where you were not editing)
The automatic builders registered in both workspaces would execute much often, and even worse, they could be conflicting with each other.
If you only need to work with the same set of versioned projects in the Eclipse instances, then maybe it would be a better idea to create a Team Project Set of your projects, and check them out into both workspaces, and share your changes through the version control system.

Using same Pydev/Eclipse environment on multiple computers

I have Eclipse + PyDev installed on my laptop and desktop, both of which are dual-boot Windows Vista 64 & Ubuntu 12.04. Right now the only 'version' I have fully fleshed out pretty much the way I want it is in Windows on the laptop. What would be the best way to duplicate (and hopefully synchronize) this across both computers and both operating systems? In this case the only one using the account(s) would be myself.
A few suggestions:
If you just want to refine your Eclipse installations with some
common configuration then allow them deviating from that point, you
could copy your workspace folder to all places you want, then switch
to those workspaces from within Eclipse. You can also export your preferences from
within Eclipse using File > Export > General > Preferences, that may work as well,
or better.
If you want to share Eclipse configuration between Ubuntu and Windows, you could install NTFS-3G in Ubuntu, then make Eclipse workspace point to your Windows partition. I'm not sure if Eclipse can deal with this well though (for example JDK path).
If you want to use same configuration for all of your devices and operating systems, and considering you won't be using more than one Eclipse instance at same time:
If you have wi-fi, you could share your Eclipse workspace in Windows then map a network drive letter in the other Windows, and mount a remote network location in your Ubuntus. You could still use second suggestion above for same device.
Alternatively, you could use rsync or similar to synchronize your different workspaces, both when you start and close Eclipse. This way, you move possible performance issues with above option from when you are using Eclipse to when you are starting or closing it.
You sync on start for getting up-to-date with latest changes from other devices, and on close because you want to push the changes you have made to other workspaces as well. In Ubuntu, you could just wrap the sync commands around Eclipse call in a shell script, and in Windows you can do the same with Hidden Start, except that it can hide shell window for you.
You could use services such as Dropbox, Skydrive or Ubuntu One to store your Eclipse workspace and let their client software do the synchronization job for you.
This is what came up to my mind. Maybe Eclipse has something built-in to deal with this other than export wizard, not sure.
What exactly to share
Remember that the workspace is where all your personal configurations reside, including the list of projects you see when using Eclipse. If some of these projects are outside workspace directory you may face path conflicts, for example C:\MyProject present in your PC but missing in laptop. You could keep all your projects within workspace directory for avoiding this though. Also, if you go for the first suggestion, export wizard as said may work better.
I don't think it's a good idea to share only part of workspace, unless you know what you are doing, and I don't see much benefit from sharing whole Eclipse directory itself (which is not possible between Linux and Windows anyway). You can find out where exactly your workspace is located in File > Switch Workspace.

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.

Specific plugins per workspace

I came across this post and wondered if there is a way to activate only a few of all of my installed plugins depending on the workspace I currently work in.
For example - If I organized my workspaces like this
/workspaces
/java
/jee
/php
...
I don't need the Android-Plugin if I'm working on my Java EE-Projects and so on.
I also came accross this, suggesting to deactivate some capabilities for each workspace. But this not an option, as apparently no plugin is registered as capability.
Thanks, m
Edit: BTW, I am using Eclipse 3.5 Galileo
Maybe you can achieve your goal but it needs lots of "customization work" so I would not do it for myself :)
Create a "minimal" Eclipse install with plugins you use all of your workspaces.
Create one dropins folder for every workspace and put all of your "workspace-specific plugins" into that folder.
Create an Eclipse shortcut for all workspaces and use something like "-data _workspacedir_ -vmargs -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=_dropindir_" in the shortcut.
Start eclipse with one of your new shortcuts.
Note that in this case you cannot switch workspace within Eclipse, you have to close the current one and start the new one using the corresponding shortcut.
UPDATE: I have found some Eclipse feature request for making this kind of setup easier if they will be implemented:
Software Update must allow to install plug-ins into extension location
Support for multiple bundle pools
You can use a different configuration folder for each Eclipse instance using the -configuration option when starting Eclipse.
On Windows, I would use a batch file (e.g. run-eclipse.cmd) which looks a bit like this (a bit different on Unix, more complex on OS X because of the app packaging):
eclipsec.exe -clean -configuration configs/%1/configuration
Execute it with your environment ID (e.g. run-eclipse.cmd java). I use eclipsec because I need the console output, but you can use the plain eclipse.exe executable. The -clean is not mandatory either.
Under my Eclipse installation folder, I will have a configs folder and under this folder I will have multiple configurations. Each config folder can have its' own plugins and folders. AFAIK, if you install plugins they will be installed in your configuration folder and not your main installation folder.
The structure you get is like this:
Eclipse Folder
plugins
features
configs
java
plugins
features
configuration
Eclipse plugins are expected to start only as needed, in a lazy manner. I'm not saying that all behave exactly that way, but if you write your own plugin, you'll see this is how the technology works, your plugin gets called only as needed.
So in Eclipse, if you configure your starting Perspective (Java for me) to have only the Views you need, the plugins that are used for other views should not be started.
To do this, take the view away and save your perspective (Windows - Save perspective as).
In addition, in Ganymede, in Windows - Preferences - General - Startup and Shutdown,
there is a list of plugins that should be started on startup, so you can edit that list.
I didn't try to see if this works per workspace though.
Although my solution won't let you install plugins per workspace but will solve the problem.
The best way i found to do this is using different eclipse copies:
Extract officialeclipse.zip to two different places and install plugins you like per eclipse.
A bit late answer but if you want to manage many workspaces shortcut the following tool is very simple and helpful : http://www.xdreamteam.ch/downloads/eclipselauncher/
I use it for sorting my projects by customers and workspaces, and it launch the right workspace with all the necessary configurations needed for each.