GeeCON Prague 2014*
The moose likes XML and Related Technologies and the fly likes Dom sample program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Dom sample program" Watch "Dom sample program" New topic
Author

Dom sample program

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
Hi,
I downloaded Jaxp1.0.1 and tried to run sun DOM sample program. It gave the following error.
C:\jaxp1.0.1>java DomEcho01 slidesample01.xml
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/tree/XmlDocument
Should I install something else?
Please help
Simon
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Simon,
You need to add the jaxp.jar and parser.jar to your CLASSPATH. Assuming you installed JAXP in c:\jaxp1.0.1, then you need to add the following to your CLASSPATH.
set CLASSPATH=c:\jaxp1.0.1\jaxp.jar;c:\jaxp1.0.1\parser.jar;
-Peter
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
hi, Peter,
I did add the classpath. In fact, Sax program runs OK, but DOM does not.
Could you figure out for me? Thanks,
Simon
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
I did not restart my computer. Now it works!
Thanks,
Simon
 
GeeCON Prague 2014
 
subject: Dom sample program