Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/Node

  Asked By: Madeline    Date: Nov 19    Category: Java    Views: 2255
  

Heres my jar file:

C:\ky\greyingout\dist\bin>jar -tf server.jar
META-INF/
META-INF/MANIFEST.MF
az/
az/vign_rmi/
az/vign_rmi/interfaces/
az/vign_rmi/server/
az/vign_rmi/interfaces/vign_rmi.class
az/vign_rmi/server/Main.class
az/vign_rmi/server/vign_rmiImpl.class
az/vign_rmi/server/vign_rmiImpl_Stub.class
dfc.jar
dom4j-full.jar

And when I try to execute it I get:

C:\ky\greyingout\dist\bin>java -jar server.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
org/dom4j/Node

As you can see dom4j* is included in the jar as a jar (thats ok isn't
it?). I know its not a problem in particular with dom4j* because if I
remove all the xml stuff I then face a problem with the dfc.jar.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Robin Hayes     Answered On: Nov 19

You need to include the jar  file as a 'Class-Path:' attribute in your
jar manifest, I believe....

 
Answer #2    Answered By: Ibtihaj Akhtar     Answered On: Nov 19

Dont put a jar  inside another jar...
Put all the jars in the same directory and include the class-path
argument in the manifest file