Since you are running on Wintel platform, you might as well create a batch file & add the following lines
 
set path=c:\jdk1.3\bin
set classpath=c:\jdk1.3\jre\lib\rt.jar;c:\jdk1.3\xerces-1_3_0\xerces.jar ; <the-dir-where-your-java-class-files-exits>
 
execute this batch file on the dos window that you are running & then do a javac src.java & java src. Hope this helps.
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, March 23, 2001 7:35 PM
To: [EMAIL PROTECTED]
Subject: this is killing me - NoClassDefFoundError

All I'm trying to do is try out Xerces. When I run my program it complains:
Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/SAXException
 
I just don't get what I'm doing wrong.
 
This is how I build:
c:\jdk1.3\bin\javac  -classpath c:\jdk1.3\xerces-1_3_0\xerces.jar  Dommy.java
 
And this is how I run:
set CLASSPATH=
c:\jdk1.3\bin\java Dommy -jar c:\jdk1.3\xerces-1_3_0\xerces.jar
 
Anyone have any ideas?
Thanks.

 
import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import java.io.IOException;
 
public class Dommy
{
 public Dommy()
 {
  String xmlFile = "file:map.xml";
 
  DOMParser parser = new DOMParser();
 
  try {
      parser.parse(xmlFile);
  
  } catch (SAXException se) {
      se.printStackTrace();
  } catch (IOException ioe) {
      ioe.printStackTrace();
  }
 
  Document document = parser.getDocument();
 }
 
 public static void main(String args[])
 {
  Dommy t = new Dommy();
 }
}

 

Reply via email to