Installing Xerces on a Windows machine can be troublesome, particularly if you've never used Java before. This is an attempt to help you troubleshoot the most likely problems. I assume that you are using the Sun JDK and working from the MS DOS prompt. If you are using an Integrated Development Environment, this may not help. Also, I was using Windows 98 when I developed this guide. I believe that Windows NT and Windows XP use a different method to set environment variables. If you discover errors in this guide, or want to suggest mechanisms troubleshoot other platforms, please send me e-mail.
Try the following steps:
java dom.Counter [some xml file]If the program executes, then everything should be set up, and you shouldn't need this guide.
java -versionIf this outputs a version number and some other information, then your PATH is correct. If this doesn't work, the see Including Java in your path below.
echo %CLASSPATH%If the system responds
ECHO is onthen your CLASSPATH is not set. See Setting your CLASSPATH below.
If you see a list of pathnames, make sure that they include paths to the xml-apis.jar file, xercesImpl.jar file, and xercesSamples.jar. For example, my CLASSPATH looks like:
.;C:\Program Files\xerces-2_5_0\xml-apis.jar;C:\Program Files\xerces-2_5_0\xercesImpl.jar;C:\Program Files\xerces-2_5_0\xercesSamples.jarIf you are missing one or more of these JAR files, see Adding JAR files to your CLASSPATH.
SET PATH=%PATH%;"[JAVA_BIN]"where you type in the directory you found in step 2 for [JAVA_BIN]. Don't forget to surround it in quotes.
path
java -version
SET CLASSPATH=.;[xerces-home]\xml-apis.jar;[xerces-home]\xercesImpl.jar;[xerces-home]\xercesSamples.jar
java dom.Counter [xml-file]
SET CLASSPATH=%CLASSPATH%;[path-to-jar]You can include multiple files by separating the path names by a semicolon (";").
java dom.Counter [xml-file]