Friday, December 28, 2012

Fedora Eclipse - update to a snapshot version

I decided to update Eclipse version to the repository snapshot and push this new build into Fedora 18. It's available in updates-testing repository. This is not something that is welcome in Fedora world as unreleased software tends to be unstable.
But this time is a little bit different. If you open the 'Install Software' dialog, you will notice that a new category appeared - Juno SR1 Patches:

This patch fixes, among others,  the most annoying issue with Eclipse 4.2.1 -
Bug 391868 - very slow switching editors; especially XML.
Only this bug made it worth to push a new build into Fedora 18. If you are interested in what else was fixed, look at this bugzilla query

Happy Hacking!

Thursday, December 27, 2012

Installing ADT into Fedora Eclipse

ADT have quite a long history of not working with Fedora Eclipse due to the various ClassCastExceptions and ClassNotFoundExceptions. Majority of those problems is caused by a simple fact - JVM provides a number of java packages that are also provided by Eclipse plugins (javax.xml, org.w3c.dom and others) and were part of Eclipse before they were introduced to JVM.

So, installing any plugin (like org.apache.xerces required by ADT) that required javax.xml caused two instances of those package to live together in different classloaders. Whenever they met, CCE or CNFE was thrown. Typical scenario was:
  • Plugin A is started and loads javax.xml (VM version)
  • Plugin B is started and loads javax.xml (bundle version).
  • Plugin C calls A, gets some javax.xml class instance, and passes it to plugin B. Since each plugin has a separate classloader, CCE is thrown.
Anyway, the solution is now known - basically you need to install eclipse and eclipse-dtp to get the hierarchy stack right - after that you may install ADT and it will work (if only you ensure that you have at least this version of xerces-j2).

Unfortunately there is no way to fix the Eclipse package itself - as it is not broken. It is just the matter of integration - and it will not happen until there is someone who is willing to package ADT for Fedora. I'm going to propose this task as a GSoC project (unless someone steps up earlier).