Eclipse - keeping several installations in sync - eclipse

Is it possible to have several installations of Eclipse (with required plugins installed) in sync? If so, what would be the preferred approach?
I am looking for a way to keep Eclipse installations (one on desktop - Wind7 64 bit, another on laptop Win7 64 bit) with the required plugins installed, in sync. Ideally, I would like to exclude the runtime generated files from the sync process. I don't have an exhaustive list of files/folders to exclude but that is the next challenge.
I tried putting one install into a local git repo, then pushing this to a remote repo, followed by cloning from the repo onto the other location. I couldn't launch the cloned instance of Eclipse. I get this error :: http://pastebin.com/BpttUgvG
Versions of interest: Helios, Indigo
I have attempted the following without success
Start with eclipse -clean
Add -vm option to eclipse.ini file
Any suggestions would be gratefully welcomed.
** EDIT **
Is it possible to do this without having to purchase additional software?

I use a script to set up my installs the exact same way on multiple computers. Eclipse comes with the p2 director, which can be used from the command line to install and update plugins.
For example, I download and untar my eclipse-SDK-I20110607-0800-linux-gtk-x86_64.tar.gz and then use the director to load my standard set of features:
bash$ eclipse/eclipse \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository \
http://download.eclipse.org/egit/updates-nightly,\
http://download.eclipse.org/eclipse/updates/3.7,\
http://download.eclipse.org/releases/indigo \
-installIUs \
org.eclipse.egit.feature.group,\
org.eclipse.egit.source.feature.group,\
org.eclipse.jgit.feature.group,\
org.eclipse.jgit.source.feature.group,\
org.eclipse.emf.sdk.feature.group,\
org.eclipse.xtext.sdk.feature.group,\
org.eclipse.releng.tools.feature.group
The director can also be used to update an install, although non-intuitively by uninstall and then re-installing the same feature in the same call.
EDIT:
For a set of IUs you can keep each install up to date using uninstall/re-install in the same director call ... if there's an update available:
bash$ eclipse/eclipse \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository \
http://download.eclipse.org/eclipse/updates/3.7 \
-uninstallIU org.eclipse.sdk.ide \
-installIU org.eclipse.sdk.ide \
I don't think you can use this approach just yet, as you need to avoid bug 368238
The director won't effect most settings (formatting, keybindings, etc) as they're workspace scoped (INSTANCE) preferences. Some like formatting or code templates can be turned into project scoped preferences, and then saved in the SCM with the rest of the project information. There are hacks as well to copy workspace scoped preferences to every new workspace that you create.

Have you tried Pulse OneInstall Agent? It is meant for this purpose. They claim that using their tool:
you and your team can retain configuration records in code
repositories (such as CVS), easily update tool configurations and have
behind-the-firewall control of your tooling recipes

You can use this simple ant script: https://github.com/shajra/provisioning-java to automate the following:
downloading of eclipse
install plugins from given update sites
copy default settings for eclipse and workspace
So you can maintain a single source for your eclipse configuration and automate the install and configuration process.

You know how I do it ? I drop the eclipse install folder in my Dropbox. Boom - absolutely synced*. That is for the same OS. If you want different OSes might work but haven't tried it. Maybe you could setup junctions/hard links to the plugins, features and configuration folders, drop those in DB and bug(zilla) them if it doesn't work. Jars should be OS agnostic. See here for my efforts to keep workspace settings in sync. See here for the pecularities of comparing eclipse installs with identical plugins
EDIT : you can selective sync out folders in Dropbox - although there is no easy way to automate it, for a couple computers is not a huge pain
* : same goes for the firefox profile and this is OS agnostic. Same for most of my settings. Gosh if they suspend the free accounts I'll have to pay them

Related

Using an Eclipse plugin without root access

I have exhausted just about every link I could find on this topic --- my Google searches are pure purple links now. It's possible I overlooked something, but anyway...
A user, who does not have root access, would like to use PyDev for Eclipse. We are using Eclipse 3.6.1, Linux x86_64. I have identified that the highest working version of PyDev that we can use is 2.8.0 (did this by using root access to discover that versions higher than that won't install).
All guides point to being able to use the .eclipse folder in the user's home directory, but no matter what I put in there, what combination of subfolders, etc., Eclipse absolutely will not detect PyDev.
Let me break down my process for testing this, one step at a time:
cd .eclipse/org.eclipse.platform_3.6.1_793567567/
mkdir dropins
mkdir dropins/PyDev-2.8.0
cd dropins/PyDev-2.8.0
wget <2.8.0 zip file>
unzip PyDev\ 2.8.0.zip
This results in...
~/
.eclipse/
artifacts.xml
configuration/
dropins/
PyDev-2.8.0/
features/
plugins/
p2/
Like I said, I've re-arranged this in multiple combinations such that "features" and "plugins" are one directory higher, two directories higher, etc. No combination will seem to do the trick.
When I execute eclipse, I'm using:
eclipse -clean -console -consoleLog
There's never any mention anywhere about PyDev's presence even being acknowledged.
A lot of the guides I've found online seem based on Windows. While eclipse.ini does exist for Linux, and while some guides say that file needs to be modified to include the home directory sub-directory, that file is inaccessible to all but root (and therefore cannot be modified).
Is this going to be doable with absolutely zero root intervention?
Why would you even need root access? Just have them download the current version from eclipse.org, unpack it somewhere, run it, and add PyDev.

Apply patch to fix bug in Eclipse?

I have a bug in Eclipse. When stepping through the code, when it goes to another class, the editor loses focus and I have to click again on the editor to continue debugging with the keyboard shortcuts.
I've found this thread describing the bug, and a patch to fix it. Is there any way I can apply the patch? I'm guessing it involves having the source code.
Yes you'd need to recompile the module and install it. These days with git SCM and the use of Maven project layouts and tycho plugin it can be easy to rebuild a module (compared to how it was just a few years ago).
Lets see now:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372941
Patches:
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java
We search on google "git org.eclipse.e4.ui.workbench.renderers.swt" we end up at the URL:
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/
This can be used to checkout the 1 module to build.
Git is available for many linux distribution by default, google you ditro name and "install git" terms for best help. On windows there is https://code.google.com/p/msysgit/ and on MacOSX there is https://code.google.com/p/git-osx-installer/ all these provide a command line environment to use git. You can look at EGit/JGit plugins for Eclipse itself to also do the job. But the instruction below are for the command line method.
git clone https://git.eclipse.org/c/platform/eclipse.platform.ui.git
Now you'll want to find the tagged version of the version you are using. So you need to find it in your eclipse/plugins/** folder of the Eclipse install. The version number maybe in the filename or in the MANIFEST.MF or other *.xml file, the version number usually indicate the date of source and/or build in the number.
It may help to browse around the eclipse.org website link above for the GIT tree to find the version. This is to get the tag or version name / commit-id (like 'abc1234':
# List tags (might see it in the list)
git tag -l
# Look through history, maybe you can work on the date
git log
# Finally once you know the version you want
# checkout the exact version that goes with your eclipse install
git checkout -b mylocalbranch <tag_or_version>
Now you can use Maven to build it.
cd eclipse.platform.ui.git
mvn package
# The full-monty would be: mvn deploy (or 'mvn install')
# But I am not sure if unit and integration tests will work this easily, using
# the 'mvn package' it enough to get you the JAR you need to install in Eclipse.
Now you can look for a .jar in the build/* subdir, you can shutdown you eclipse and place this JAR into the plugins folder, ensure the version number is newer.
If it works update the bug report. Saying it worked for you.
Also consider trying to push it via the github accounts as a new change, crediting the original author.
..
DISCLAIMER: The above is the principal about how you might achieve what you want. It might take less than 5 minutes to complete. But there maybe complications and you'll need to research those (if you get any) independently.
You can also do much of the above with Eclipse itself, a 'git checkout' and a 'build Eclispe plugin module', although for me for this change it would probably take longer maybe 15 minutes (if there are no complications).

STS (Spring Tools Suite) writes STS.ini any time I get updated, merging with my own configuration

To improve my STS performance I've added some parameters to STS.ini. But every time I update the tool, it puts its own configuration at the beginning of STS.ini file, relegating my configuration to the end, sometimes duplicating several parameters.
Is there another way to avoid this?
Now, everytime I update the tool I need to backup the file and check the parameters...
I tend to launch Eclipse and STS from the command line. I create a bunch of shell scripts, one for each variant of Eclipse/STS that I run. This ensures that every launch has precisely the arguments that I need.
For example, I have a bunch of scripts like this:
[21:09] ~/Eclipse
$ more eclipse_42.sh
Installations/Eclipse4.2.M6/Eclipse -data \
"/users/Andrew/Eclipse/Workspaces/workspace_42" \
-vmargs -Xmx1024M -XX:PermSize=64M -XX:MaxPermSize=256M
I like running from a terminal so that you can see what gets sent to sysout. And this could also be launched from a Finder window.
I run on Mac, but you could do something similar on Linux or Windows.
Just thought of another possible answer. I haven't tried this, but it could work.
Instead of doing "Check for updates", go to the install manager Help -> Install new software...
With the STS update site, select all the components that you want updated (except SpringSource Tool suite (required) and SpringSource Tool Suite Package (if you see it)).
I think it is these two components that alter the STS.ini. The only thing that I am not sure of is if it is at all possible to update individual components without updating that package.

Plugins won't install on Eclipse

I am trying to install subversive and checkstyle onto Eclipse IDE for Java Developers however the following message appears:
"Cannot complete the install because one or more required items could not be found.
Software currently installed: Shared profile 1.0.0.1316138460759 (SharedProfile_epp.package.java 1.0.0.1316138460759)
Missing requirement: Shared profile 1.0.0.1316138460759 (SharedProfile_epp.package.java 1.0.0.1316138460759) requires 'org.maven.ide.eclipse [1.0.100.20110804-1717]' but it could not be found"
What does it mean? Is there another way to install them as I need both plugins for my course.
Please help and thank you :)
Try running Eclipse as administrator, I just had the same issue and this worked for me.
There's an alternative to running Eclipse as an administrator: you can manually give write permissions to your "eclipse" folder for all users (or just your current user).
This way Windows/UAC won't pop up the security question that you see when you run programs as admin.
Hi I had the same problem just yesterday.
I was uploading SDK for android and found your question in a google search.
I reverted back to an older version of eclipse. Link to older version of eclipse
This solved it for me.
Remember to delete eclips from your program files. You do this by just physically deleting the file from program files (not through uninstall). Then also make sure you delete your workbench. This is a file called workbench in your docs. Well mine was in my docs, it could be somewhere else on your system.
I am using windows 7.
Best of luck.
I had this problem, but I had to dig harder to fix it.
The source of my problem was the shortcut to launch Eclipse had this in the Target field:
"C:\Program Files\eclipse\eclipse.exe" -configuration C:\Program
Files\eclipse\configuration
The problem with this is that without double quotes around the "-configuration C:\Program Files\eclipse\configuration" section it would hit that space in 'Program Files' and use C:\Program for storing configuration some of the time. Generally, if you have C:\Program you should make sure programs didn't put random files in there by mistake.
To fix this I had to move the configuration files from C:\Program to C:\Program Files\eclipse\configuration, picking and choosing along the way. Change the Target field to:
"C:\Program Files\eclipse\eclipse.exe" "-configuration C:\Program
Files\eclipse\configuration"
and I was good to go.
I had the same problem, and I solved it by setting
"Contact all update sites during install to find required software"
to true.
(I used the Eclipse install manager, in
Eclipse IDE for Java Developers,
Version: Indigo Service Release 1
)
In my case, updating to the latest version of Eclipse (Juno) did the trick. Perhaps your add-on won't run on your version?
I think you need the maven plugin in order to install your plugin. If that's the case, you can follow this this instruction to install it.
Use eclipse update manager to install the plugins.. Then it will automatically select dependent plugins..You dont need to bother about dependent plugins in that case
All I had to do was completely open up full permissions for all users to the directory. This is dangerous if you have a multi-user system but Windows 7 seems to default to giving processes not very high permission levels; some processes (such as Eclipse Updated) don't know how to deal with this and request user permission, so they just bomb out. Easy fix: full control to all users and processes for the Eclipse Directory.

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.