jn025
jn025

Reputation: 2895

Java compiling: NoClassDefFound & ClassNotFoundException

I am trying to compile my java program using netbeans into a single .jar file, and holds multiple libraries. I am getting the NoClassDefFound & ClassNotFoundException errors when trying to run via the cmd using: java -jar javafile.jar I have put my lib folder with all libraries inside the 'dist' folder. Here is the error output in the cmd line:

enter image description here

It is for this particular library however it isn't added any different from the others and it doesn't seem like the others are throwing out errors of the class not being found.

Upvotes: 0

Views: 162

Answers (1)

Neil
Neil

Reputation: 1938

It's probably best to check the manifest file in your JAR file, which contains the classpath.

Try this:

jar xvf javafile.jar

That should extract the manifest to META-INF/MANIFEST.MF. Look at the MANIFEST.MF file and find the "Class-Path:" entry. Does it contain the JAR file that contains the ZipException class?

Upvotes: 1

Related Questions