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).

No comments:

Post a Comment