NoClassDefFoundError

I coded a small application in Netbeans, and used the AbsoluteLayout it provides for designing the GUI. Everything compiles and runs fine within Netbeans, but after I JAR the project and try to execute it a NoClassDefFoundError is thrown. The exact error looks like this:

java.lang.NoClassDefFoundError: org/netbeans/lib/awtextra/AbsoluteLayout

I don't have much experience with JARing, and this is the first application I've wrote with Netbeans, so I'm a bit lost as to why this is occuring. The manifest is written correctly, and I can see the the program begins execution, but this error is thrown when exected as a JAR.

Any idea how this problem can be fixed? Is there a way to include the missing class definitions with the JAR?

Comments


  • Make sure the contents are in the .jar with jar tvf x.jar. Then you need to put the jar in your -classpath.

    Example:

    java -classpath x.jar; com.ronsoft.books.nio.buffers.BufferDupe

    x.jar contains the directory structure of the package information, so I still need to call the program, BufferDupe, with the directories.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion