• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

appletviewer giving NoClassDefFound error

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an applet which compiles fine, but when I try to view it using
the appletviewer, with the applet tag

<APPLET CODE="com\rephunk\PunnettApplet.class"
ARCHIVE="punnettjar.jar,c:\java\myclasses\kclasses.jar"
WIDTH=200 HEIGHT=100>

</APPLET>

I get a NoClassDefFound error for com/rephunk/GraphPanel. GraphPanel is the first class used from the kclasses.jar. I checked that it is in the jar file and it does have the package statement, and the kclasses.jar file is in the myclasses directory.

Any help would be greatly appreciated!

-Karen.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So com\rephunk\PunnettApplet is in punnettjar.jar, and com/rephunk/GraphPanel is in kclasses.jar? I'm not quite sure if this is the problem, but not all classloaders like having classes of the same package split over several jar files. Try using just a single jar.
 
Karen Nelson
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I have put all of my "generic" classes into a package (com.rephunk.myclasses), and kept the applet class out of the package. Appletviewer still will not show me the applet, with the same error message. If I make some manual changes to the applet file to allow it to run as an application, everything is fine.

Am I just missing something in the tag?

-Karen.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

CODE="com\rephunk\PunnettApplet.class"



This should actually be CODE="com.rephunk.PunnettApplet.class" , because it is a class name, not a directory path.
 
reply
    Bookmark Topic Watch Topic
  • New Topic