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
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
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
... trying to help
8,496 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
Can you print the contents of the manifest file and the jar and post the results here?
jar tf kort.jar
JamesCherrill
... trying to help
8,496 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
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
... trying to help
8,496 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
package 'thingy'? what is a package 'thingy'?
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
OK, now what is the package statement at the start of the source code for KortBord?
JamesCherrill
... trying to help
8,496 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
ehm ... I thought you said the line was:
Main-Class: src.KortBord
?
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
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
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
so, you manually place your classes in the bin folder?
if you do, I assume that's your problem.
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
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
... trying to help
8,496 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29