Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Eclipse, Xerces, and 1.4 VMs

[plan item] Remove dependancy on Xerces

Now that the latest Eclipse downloads require a 1.4 VM to run, many of you
have noticed that there are problems when running various 1.4 JREs. Many of
our plug-ins in the SDK perform XML processing and therefore require the
org.apache.xerces plug-in. As part of the JAXP API in 1.4, various VMs ship
Xerces/XML4J as their implementation. This is problematic for Eclipse users
for 2 reasons:
    1). the version that is shipped with a JRE is not necessarily the same
version that is included in the org.apache.xerces plug-in that Eclipse
    2). our code references Xerces specific classes and since they are now
provided by the JRE, the version in the JRE is picked up by the
classloaders instead of the intended version in the plug-in.

Temporary Solution:
Java 1.4 VMs include an "endorsed" feature so the user can specify another
implementation of a standard. We can use this to tell the VM to use the
version of Xerces which is shipped with Eclipse rather than the default.
There are multiple ways to override this implementation, but the easiest
(without modifying your JRE install) is to specify System properties via
the command-line arguments.

For instance:

eclipse -vm c:\java\my14vm\jre\bin\java -vmargs


Note that the java.endorsed.dirs property should contain the directory of
the Xerces version that you want to use. In the above example, it points to
the org.apache.xerces plug-in directory in my Eclipse install.

Please note that this is only a temporary solution and opens the door for
other potential problems. (e.g. what if you have other code which is
relying on the Xerces version which is included with the JRE?)

More information on the Endorsed Standards Override Mechanism can be found

What do I need to do?
We intend to remove the Eclipse SDK's dependancy on the Xerces
implementation. The best way for us to do that is to remove our Xerces
dependant code and program against the JAXP APIs provided with 1.4. (this
includes both regular plug-ins, tests, and examples)

To ensure that you have removed all of the implementation specific
dependancies in your code:
- Development-time references: update your project classpath so that xerces
is not a project reference or a referenced JAR (Project Properties -> Java
Build Path)
- Runtime references: remove the <import plugin="org.apache.xerces"> line
from your plugin.xml's <requires> tag
- also make sure you run with your new code....remember no red x's doesn't
mean its ready to ship! (we don't give half marks for compiling but not
running :-)

There are PDE tools to help you figure out which plug-ins need to be
- open the "Plug-ins" view
- right-click on "org.apache.xerces"
- bring up the context menu
- select "References"
Note that this list is constructed by looking at the plugin.xml files and
that you should change your project's classpath file as well.

Here are some links to 1.4 XML info to help with your conversion:

It is extremely important that we make these changes. Eclipse will not run
with all JRE 1.4 VMs until everyone changes their references. Our goal is
to have the code in the SDK converted by M5, please adjust your milestone
plans accordingly.

Of course you ask, are we removing the org.apache.xerces plug-in from the
SDK distribution? We are currently investigating this but are not sure if
that is possible.


Back to the top