jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes java.lang.NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.lang.NoClassDefFoundError" Watch "java.lang.NoClassDefFoundError" New topic


Payam Mamaani

Joined: Jul 04, 2001
Posts: 7
When I wrote a java application it using JFrame works fine. but I changed it to an applet (JApplet), I got error message in run time:
java.lang.NoClassDefFoundError: Project1$5
at Project1.showFieldCombo(Project1.java:331)
at Project1.ComboBoxShow(Project1.java:475)
at Project1.init(Project1.java:492)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484)
Process Exit...
I'm using a signed applet as a jar file and the jar file is in my classpath.

Thanks a lot,
Suma MM
Ranch Hand

Joined: Apr 30, 2001
Posts: 31

I am not able to figure out if u did define a .html file to make the applet run or if u had just changed the JFrame to JApplet and tried rerunning the same code using "javac" for compilation followed by "java" to run the applet.

U might want to "copy-paste" ur code in ur reply so that things get clearer.

[This message has been edited by Suma MM (edited July 07, 2001).]
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Are you testing the JApplet in your browser or with the appletviewer. I don't believe most browsers support Swing. I think you need to install a plugin.
Payam Mamaani

Joined: Jul 04, 2001
Posts: 7
Thanks a lot for your replies,
I found the problem , I had used a jar file and some of my class file (with nnnn$#) weren't in the jar file.
Thanks again,
I agree. Here's the link: http://aspose.com/file-tools
subject: java.lang.NoClassDefFoundError
It's not a secret anymore!