Project

Profile

Help

Newbie question: How to run DTDGenerator?

Added by Anonymous almost 16 years ago

Legacy ID: #5156452 Legacy Poster: Peter (pjfarley3)

Hi all, I am pretty much a newbie to running java (I have had a class, I have done some minor tutorial programming in java). I need to generate a DTD for some XML I am working with, and I have tried to run the DTDGenerator distributed on the Saxon site but I am getting the following errors when I do try to run it (WinXP Home SP2): C:\MyProject>java DTDGenerator mylocal.xml Exception in thread "main" java.lang.NoClassDefFoundError: DTDGenerator Caused by: java.lang.ClassNotFoundException: DTDGenerator at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) I have the jdk paths set in my PATH and CLASSPATH variables: C:\MyProject>echo %PATH% C:\Program Files\Java\jdk1.6.0_07\bin;C:\Program Files\Java\jdk1.6.0_07\jre\bin; C:\DJGPP\bin;C:\UT;C:\BAT;C:\PT;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System 32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\IBM \Personal Communications;C:\Program Files\IBM\Trace Facility;C:\Program Files
QuickTime\QTSystem;c:\Regina;C:\Program Files\Common Files\Intuit\QBPOSSDKRunti me C:\MyProject>echo %CLASSPATH% C:\Program Files\Java\jdk1.6.0_07\lib;C:\Program Files\Java\jdk1.6.0_07\jre\lib; .;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip;C:\Saxon;C:\Saxon\DTDgen C:\Saxon\DTDgen is where the dtdgen.jar file is located, and it seems to recognize that and start the "main" procedure in the dtdgen.jar file, so why can't it find the DTDGenerator class defined in the jar file? Thanks in advance for any help/RTFM/pointers you can provide. Regards, Peter


Replies (1)

RE: Newbie question: How to run DTDGenerator? - Added by Anonymous almost 16 years ago

Legacy ID: #5202568 Legacy Poster: Michael Kay (mhkay)

Just noticed this one is unanswered - I remember answering it, but I must have made the classic mistake of replying to the notification email rather than visiting the forum itself. When Java code is held in a JAR file, the JAR file itself needs to be on the classpath. It's not enough (indeed its unnecessary) for the directory contaiing the Jar file to be on the classpath.

    (1-1/1)

    Please register to reply