AW: [jdom-interest] jdom run
Andreas Wolf
aw at orange-interactive.de
Mon Feb 18 06:10:15 PST 2002
Hi!
Make sure the source-file containing your SAXTest class is named
'SAXTest.java'. The compiled class must spell 'SAXTest.class'
just tested your code and the java.lang.NoClassDefFoundError occurs if the
file isn't named correctly.
Orange-Interactive GmbH
Andreas Wolf
-----Ursprüngliche Nachricht-----
Von: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]Im
Auftrag von ShantAdam
Gesendet: Montag, 18. Februar 2002 14:43
An: jdom - interest
Betreff: [jdom-interest] jdom run
So now I have the jdom.jar in my classpath as follows:
CLASSPATH=
".;
C:\Program Files\jdk1.3.1_01\lib\tools.jar;
C:\Program Files\jakarta-ant\bootstrap\lib\ant.jar;
C:\Program Files\xml_api\jdom\build\jdom.jar;
C:\Program Files\xml_api\jdom\lib\xerces.jar;
C:\Program Files\xml_api\jdom\lib\crimson.jar;
C:\Program Files\xml_api\jdom\lib\jaxp.jar;
C:\Program Files\xml_api\jdom\lib\xalan.jar;
C:\Program Files\xml_api\sax2\sax2-r2pre3.jar;"
I have these files copied in the following directory:
C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext
crimson.jar
jaxp.jar
jdom.jar
sax2-r2pre3.jar
xalan.jar
xerces.jar
Same files are copied in this directory:
C:\Program Files\jdk1.3.1_01\jre\lib\ext
crimson.jar
jaxp.jar
jdom.jar
sax2-r2pre3.jar
xalan.jar
xerces.jar
But I'm getting this error message:
Exception in thread "main" java.lang.NoClassDefFoundError:
SAXTest("NamHyData")
when I'm runing my SAXTest.class with the following code:
import java.io.File;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
public class SAXTest{
public static void main(String[] args){
if (args.length != 1){
System.out.println("Usage: SAXTest(filename to parse)");
return;
}
try{
//Request document building without validation
SAXBuilder builder = new SAXBuilder(false);
Document doc = builder.build(new File(args[0]));
System.out.println("Document successfully read");
}
catch(JDOMException e){
e.printStackTrace();
}
}
}
What can you determine as wrong move or programming?
Multispex Designs
Rep.: Shant Adam
Tel.: (514) 827-4840
adams at multispex.com
http://www.multispex.com
---
Visual technology service provider.
Fournisseur de service de technologie visuel.
---
Copyright 1998-2002©
Multispex Designs®
More information about the jdom-interest
mailing list