Installing a SAX2 Parser
Unless you use JDK 1.4 (which bundles SAX2 and
the Crimson parser) or some other environment that’s already
set up with SAX2 support (such as any up-to-date web application
server), you will need to update your Java
programming environment so that you can use SAX. Consult the
documentation that comes with your parser and Java Virtual
Machine for specific details. Assuming the SAX interfaces
and your SAX parser are distributed in a single JAR file
called xml.jar (you’ll need to know and
use the correct full pathname, including the directory),
you’ll probably use one of these approaches shown in the following list.
- Add to extensions directory
If you use JDK 1.2 or later for your runtime environment,[6] you can install the JAR file into the
jre/lib/extsubdirectory of your Java distribution. This is the preferred solution during development, since it’s the simplest and least error-prone.On Windows, you may need to add this to two different locations: one for the development environment as well as one for the runtime environment.
- Update class path on command line
This solution works with JDK 1.2 and later. Whenever you invoke a program that needs the SAX support (such as java, javac, or javadoc) pass the -cp xml.jar parameter to add SAX to the class path.
- Add to CLASSPATH in environment
This is the original way to add software to your Java environment, and it works on a JDK 1.1-based system and on many Java implementations that aren’t derived from Sun’s ...