Views
- State: published
Eclipse Survivor Tip #1: Avoid Crimson
Eclipse has a well know dependency on the Xerces parser. Bug 37696 describes the many places where the Xerces parser is used. Unfortunately, we had to discover this the hard way when one of our customers was having difficulty installing our application. It turns out that the default parser for his configuration was set to use Crimson.
There seems to be a tug-of-war happening between IBM and Sun as to what parser needs to be the default. It's quite analagous with the tug-of-war between Netscape and Microsoft when it comes to setting the default browser. Unfortunately this tug-of-war is more insidious in that it happens deep inside the code and is extremely difficult to spot. The potential breaking points in Eclipse are as follows:
- Team CVS Import and Export and Comment History
- Help Contributions
- Class path setting in .classpath
- JDT Template files
- Parsing of plugin.xml and fragment.xml
- Parsing of site.xml in update sites
- Welcome page
- Storing of View State
- EMF based plugins (includes both Visual Editor and WTP)
The Eclipse development team has claimed that the Crimson parser has bugs that make it impossible if not too risky to migrate their code to support the default JDK 1.4 parser. Sun on the otherhand has embedded inside its JVM mechanisms to ensure that Crimson is selected as the default compiler. It's an extremely bad situation for casual users of Eclipse.
The solution I have found is to place a jaxp.properties:
javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
that points to the Xerces parsers in the JAVA_HOME\jre\lib directory and the Xerces jars (copied from Eclipse) into the JAVA_HOME\jre\lib\ext directory. It 's a drastic option however you need it to ensure the stability of your primary development environment.