Compiling XML parsers (xerces, Dom4j, etc...)
Ray Auge
rayauge@doublebite.com
Thu Nov 4 00:09:00 GMT 2004
Hi All,
This is partly in reply to the two recent request for solutions in
compiling XML parsers. I think I have answers as well as more questions.
Please (listers), correct me where I make mistakes (cause these are
random recollections as well as info I've garnered through questioning
this very list).
First, gcj can in fact compile jar files into usable libraries (as we
all know or have read), but there are limitations which are not clearly
advertised or documented (at least not in any obvious way).
1) The first limitation is that in order to get working libs from jars
you have to work with this assumption. The jar can only contain one
package. If the jar contains more than one package, the compile will
succeed but calls to the lib will fail because the limitation on the
exported symbols of a lib (i.e. a lib basically has only one name-space,
will a jar has multiple name-spaces). So, if you wish to compile a jar
with multiple packages (just about every widely used java package
including most XML parser lib.) you'll have to compile each and every
package into it's own lib, kind of like what you seen when you build and
install any of the RHUG tools.
You should end up with (for classpathx-jaxp as an example):
lib-org-xml-sax.so
lib-org-xml-sax-ext.so
lib-org-xml-sax-helpers.so
lib-gnu-xml-aelfred2.so
etc...
2) The second limitation is in packages that involve the inclusion of
resource bundles (like most XML parsers do, as in the configurations).
This I haven't dealt with yet and was the basis of my own questions
which I was hoping to have answered on this list (until I saw these
other related questions).
So, I'd like to request that one of the gcj developers take a few
minutes and explain to the rest of us what a proper procedure would be
to compile (in a high level way) a jar with multiple packages and
resources into usable set of libs...
I'd personally really appreciate this.
Thanks,
--
Ray Auge <rayauge@doublebite.com>
More information about the Java
mailing list