back to developerlife.com
Parser Classpath
for JDK1.2
Parser Classpath for JDK1.2
Author: Nazmul Idris
Date: March 18 1999.
Copyright Nazmul Idris 1998-2006. All Rights Reserved. 
Index
Introduction
How to setup CLASSPATH for JDK1.2


go to topIntroduction
Many readers have asked me questions about the CLASSPATH and getting the Java XML parser jar files setup properly to use with their JDK1.2. Unfortunately, this is a little confusing because the JDK1.2 ignores the CLASSPATH environment variable by default.
go to topHow to setup CLASSPATH for JDK1.2
All the core class libraries that come with the JDK1.2 are stored in a file named "rt.jar". This file is in the "jre/lib/" folder under the folder in which you installed your JDK1.2 (on any platform). So you must know the fully qualified filename for the rt.jar file. You must also know the fully qualified filename for the XML parser jar files. Here is a list jar filename for the currently crop of parsers:
 
Parser Name Jar file
Sun Project X Technology Release 1 xml.jar
IBM XML Parser for Java v2.0.4 xml4j.jar
OpenXML v1.0.4 openxml.jar

On my system here are the locations for these files (on WinNT):
 

Jar File Location
rt.jar c:\dev\jdk12\jre\lib\rt.jar
xml.jar c:\dev\libs\xml.jar
xml4j.jar c:\dev\libs\xml4j.jar
openxml.jar c:\dev\libs\openxml.jar

So my CLASSPATH is set as such:
set CLASSPATH=c:\dev\jdk12\jre\lib\rt.jar;
    c:\dev\libs\xml.jar;c:\dev\libs\xml4j.jar;
    c:\dev\libs\openxml.jar

Now, when I invoke the JVM from my command prompt, I type:
java -cp %CLASSPATH% DomView

You can make a batch file called runjava.bat which might look like this:
java.exe -cp %CLASSPATH% %&

Now I can run my Java programs like this:
runjava DomView

The instructions for a Unix system is similar, because the JDK12 java.exe program takes the same command line parameters on all platforms.

Please go to the tools section to actually download the Parsers themselves. 

I hope you find this information useful. If you wish I can have instructions for Solaris and Linux on here too, let me know.

go to top
Copyright © Nazmul Idris 1998-2006. All Rights Reserved.
Last Updated: Mar 18 1999.