JDK 1.2 will have features which should help with this:
The JAR file manifest has been extended to provide version information and
to let packages define the extensions and libraries that are needed and to
provide links to JAR files containing the extensions if they are not
available locally.
So:
SAX should be packaged as an extension (this doesn't require and change to
the code, just the manifest in the JAR file).
Parsers should be packaged so that their manifest shows that SAX is required
and, optionally, provide their own version.
SAX should have a well defined convention for version numbering and this
should be implemented in the JAR file manifest.
Parsers should check the version of SAX loaded using
java.lang.Package.isCompatibleWith() and complain if the check fails.
JDK 1.2 pretty much removes the need for CLASSPATH (and about time).
[It's a shame that manifests aren't marked up in XML!]
John Wilson
The Wilson Partnership
5 Market Hill, Whitchurch, Aylesbury, Bucks HP22 4JB, UK
+44 1296 641072, +44 976 611010(mobile), +44 1296 641874(fax)
Mailto: tug@wilson.co.uk