well, the api's state that a NoClassDefFoundError is:
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
so probably something is missing when you run your .jar.
'm not really sure what to look for here.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
Two more things to check:
is the class file in a folder called "src" in the jar?
is all the capitalisation correct (file names in a jar are case-sensitive)?
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Can you print the contents of the manifest file and the jar and post the results here?
jar tf kort.jar
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Can this possibly have anything to do with the package thingy?
Yes. Your class file has to be in a directory structure that exactly follows the package structure
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
package 'thingy'? what is a package 'thingy'?
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
OK, now what is the package statement at the start of the source code for KortBord?
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
ehm ... I thought you said the line was:
Main-Class: src.KortBord
?
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
well, first of all, in that part of Manifest code you showed, the line was:
Main-Class: bin.KortBord
you have to link to your class, not to your .java file.
what does the package statement in your .java file say?
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
so, you manually place your classes in the bin folder?
if you do, I assume that's your problem.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
Your class directory structure must exactly match your package structure. If you have no package spec then you should not have any directories for the class files, they should just be "loose" in the jar.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073