IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes NoClassDefFoundError when running Swing Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "NoClassDefFoundError when running Swing Applet" Watch "NoClassDefFoundError when running Swing Applet" New topic
Author

NoClassDefFoundError when running Swing Applet

Ian Morris
Greenhorn

Joined: May 23, 2001
Posts: 7
I have used Sun's Forte IDE to generate a SWING Applet. It compiles with no errors, however, when I try and execute it within the IDE I get the following error:
java.lang.NoClassDefFoundError: web-inf/classes/JApplet (wrong name:JApplet)
When trying to run the applet via a browser I get the following error:
java.lang.ClassNotFoundException: ..JApplet
I have loaded Sun's plugin 1.3.1_01 and can run Sun's helloSwingApplet. What am I missing on my server???
I have searched on Javaranch for this error but cannot find any references, I would be gratefull if someone could point me in the right direction.
Thanks.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4120

Not sure about the Forte error, but to fix the browser error you will have to run htmlconverter on the HTML page you are launching your applet from. This lets the browser know you want to run your applet through the Java 2 Plug-In rather than the old browser JVM. You can download htmlconverter from Sun, and they should have some instructions on how to use it.

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Ian Morris
Greenhorn

Joined: May 23, 2001
Posts: 7
Hi Nate,
Thanks, my SWING applet is working fine now. I did read Sun's information on the HTML Converter but was not sure if I needed it, I guess I did.
I am new to Applet's (I have written servlets in the past), and think, at the moment, that using SWING is not as easy and convenient as I had first hoped, maybe that will change as I practice more.
Thanks.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4120

Using Swing will be tough for a while with applets... until either the browsers standardize and upgrade their JVMs ( ) or all users download the Java 2 Plugin ( )

-Nate
 
 
subject: NoClassDefFoundError when running Swing Applet
 
Threads others viewed
Problem when running with browser, fine when run with "java colorswitch.ColorSwitch"
webpage error
Need help converting complex Swing App to Applet
Need help converting complex Swing App to Applet
Applet an application
MyEclipse, The Clear Choice