[jdom-interest] Well I've been FAQed

Gordon Tyler gordon.tyler at sitraka.com
Fri Nov 8 08:22:47 PST 2002


Doug Robinson wrote:
> Hello
> 	As a newcommer to jdom I am stumbling around through the simplest things.
> e.g.I run my test program and get thin message:
> 
>  java -jar MyMail.jar
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/jdom/JDOMException
>         at MyMail.MyMail.init(MyMail.java:13)
>         at MyMail.MyMail.main(MyMail.java:31)

Observe the following in the java executable documentation:

http://java.sun.com/j2se/1.4.1/docs/tooldocs/linux/java.html#-jar

Using the -jar command makes java ignore all other classpath settings 
except what is specified in the JAR's manifest file.

What I would recommend that you do is put all the JARs that MyMail.jar 
requires in the same directory and add the following to MyMail.jar's 
manifest:

Class-Path: xerces.jar jdom.jar

See the following for more information about the format of the JAR manifest:

http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html#JAR%20Manifest

Ciao,
Gordon

-- 
Gordon Tyler
Software Developer, R&D
Sitraka -- Performance is Mission Critical




More information about the jdom-interest mailing list