Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[stellation-res] Eclipse and IBM 1.4.x JVMs (Workaround Needed on Linux,Windows,...)

I have resolved the configuration problem mentioned in various
posts over the past few days.  (Sorry it took so long, but I was
totally offline from Friday AM until Tuesday afternoon).

The IBM 1.4.x JVM distributions include a version of Apache Xerces
in $JAVA_HOME/jre/lib/xml.jar (or equivalent location).
This 'masks' the version of Xerces bundled with Eclipse, which is
needed during startup and for routine Workbench operations.
This masking causes a version mismatch, which leads to
a number of bad things.

This problem does _not_ occur with SUN JVMs, because Xerces is
(apparently - I haven't investigated) not packaged with these JVMs.

For further details, see Bugzilla item #43022, entered on 9/12 (about the
time that the pilot of my flight determined we had a broken rudder,
fortunately just _before_ we left the ground, which subsequently required
a change to "new equipment" [new plane, rather than new laptop :<(]).
There was a flurry of Bugzilla activity on Friday, resulting in a workaround
and a backpointer to Bugzilla #39187.

The workaround as posted is flawed, and I will shortly update the Bugzilla
entry.

Here is the Bugzilla comment giving the resolution:
-------------------------------
With IBM JDK 1.4.1, Xerces comes in the jre\lib directory (xml.jar) and it
is in the boot classpath for any Java application. But Eclipse must use its
own Xerces version.

You can work around that by:

- renaming the xml.jar to something different (e.g. xml.jar.donotload) -
this has the caveat that any of your other Java programs that need the XML
APIs and share the same JDK will not work.

- prepending the boot classpath with Eclipse's Xerces JARs
(xmlParserApis.jar and xercesImpl.jar) using the -Xbootclasspath/p
command-line option. For example:

eclipse.exe (all your regular options) -vmargs \
-Xbootclasspath/p:d:\i20030910\eclipse\plugins\org.apache.xerces_4.0.13\xmlParserApis.jar; \
   d:\i20030910\eclipse\plugins\org.apache.xerces_4.0.13\xercesImpl.jar
-------------------------------------

I first tried renaming .../jre/lib/xml.jar (and xerces.properties) as a quick test, but
found this didn't work (at least with my RH9 installation as configured).

The second method (using -Xbootclasspath) works, but not quite as written.
Obviously, the actual path must be adjusted (e.g to "/opt/eclipse/plugins/..."
for my Linux installation).
However, the name of the xmlParser... jar is misspelled: it should be
"xmlParserAPIs.jar", not "xmlParserApis.jar".
While this doesn't matter on Windows, where this workaround was tested,
the Linux filesystem is case-sensitive.

With these changes to my launch script, Eclipse 3.0M3 with IBM Java2-141 passed
my test case:
1) create a totally empty workspace
2) launch Eclipse with -data pointing at the empty workspace
3) import org.eclipse.core.* and their required projects (all as binary plugin projects)
4) Build.

Previously, classpaths were not generated and the build failed.
Now, everything works as expected.

I don't know why others had no problems with IBM Java2-141; perhaps their
$CLASSPATH settings differ from the settings I use.

I'm continuing now to bring the repository contents fully up to date.

Regards,
Jim
--
Jim Wright, IBM T.J. Watson Research Center
*** The Stellation project: Advanced SCM for Collaboration
*** http://www.eclipse.org/stellation
*** Work Email: jwright@xxxxxxxxxxxxxx ------- Personal Email: jim.wright@xxxxxxx



Back to the top