Saturday, May 19, 2012

Eclipse in Fedora - 0 day update

Eclipse bundled by Fedora will contain additional fixes that are not yet a part of Juno release:

1. Predefined update sites

You may say that's all Eclipses have that, but it is not quite true. You have not just used Eclipse with a shared configuration. However, in Linux, this is a default installation, so many many people reported this problem, and for some Linux distributions it was a blocker that prevented them from including Eclipse. But things are getting better - Fedora, and eclipse-build, now include a fix for that issue.

2. Discover renamed jars in dropins.

Again, this issue does not happen often in regular Eclipse installations. But if for some reason you need to rename a jar in dropins, P2 will refuse to load it. In Fedora, each jar should be packaged only once (f.e. junit), so each discovered duplicated library is replaced with a symlink. Sometimes Eclipse refused to resolve dropins, now we know why :-).

3. Reconciler debugging options are now in a default installation.

As of previously, when anyone reported the problem with Eclipse not being loaded fully, we had to guide him through creating the .options file, putting it in right directory and gathering logs. Now it is easier. To get a hint what is going on with reconciler it is enough to invoke following commands:
$ cd /usr/lib64/eclipse
$ ./eclipse -debug -clean > reconciler.log

4. Eclipse cannot be run as root.

This is the most controversial change, but when you try to launch Eclipse as root, you will get:
# eclipse
CompilerOracle: exclude org/eclipse/core/internal/dtree/DataTreeNode.forwardDeltaWith
CompilerOracle: exclude org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.
CompilerOracle: exclude org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.instantiateTemplate
CompilerOracle: exclude org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.addBinding
CompilerOracle: exclude org/python/pydev/editor/codecompletion/revisited/PythonPathHelper.isValidSourceFile
CompilerOracle: exclude org/python/pydev/ui/filetypes/FileTypesPreferencesPage.getDottedValidSourceFiles
This application should not be run by the owner of the shared configuration.

and exit code will be 14.

The reason behind that is pretty simple - when you invoke the Eclipse as root, everything what you have in dropins will be written into the master configurations. And later, when you change your installation layout using RPM, things will go ugly, because the master configuration will not reflect what is really installed.

If you really, really need to launch Eclipse as root in Fedora, and you know what consequences are to expect, please remove -preventMasterEclipseLaunch from your /usr/lib64/eclipse.ini.

Note 1. All paths used in this blog post are for 64 bit systems. If you happen to run 32 bit Fedora, please replace every lib64 with lib, so the base Eclipse installation folder will be /usr/lib/eclipse.

Note 2. Fedora 17 (a.k.a. Beefy Miracle) is out pretty soon. You can grab beta here.


  1. Hi Christopher,
    can you elaborate the solution for the problem #1 (Predefined update sites)?

    1. Sure. The source of the problem is that P2 has a specific preferences scope (which name I have forgot, but that's not important) which stores update site urls as preferences next to the profile.
      In case of a shared configuration, the profile is stored in user.home, but update sites are in master configuration, so are invisible.
      When the Update Dialog is invoked, I simply check (as the last step, to not store anything in user location) if the installation is a shared one, and, in case if it is, I locate the master profile, initialize the preferences scope using example I found in tests, and copy important bits.
      The patch is available in the bug. I had to create a service to minimize the cross-bundle dependencies changes. Let me know if this is sufficient :-).

    2. Ok, thanks, this is sufficient. I've expected something smaller/easier then that patch. Kind of clever workaround without to patching the platform. We are both provider/consumer of Eclipse IDE and I was looking for the easy solution for both developers/customers and for different Eclipse versions (3.7.2 / 3.8).
      Anyway, thanks a lot.

    3. No such luck. I guess if there was easier solution someone would have fixed it long time before me :-).

      Actually it would be possible to create a plugin that once deployed would copy what is required, but that is a kind of solution you would not apply in an enterprise world.

  2. Thanks for your hard work. Numbers 2 and 4 have caught me out a bunch of times :-)

    1. Thanks, more is coming. But I must admin I am afraid to release patch for - that's probably the last "big" issue with the reconciler.