Run an Applet with a package statement
Hello All;
This is very simple and I know some one out there will solve it using his left hand.
I have this very simple "Hello World" applet. if the forCounter.java file has a package statement in it
like:
package ch5.fig05_02;
// rest of the code goes here
and after I compile and get the forCounter.class file and try to launch the applet using the *.html file
which in the same directory, the applet fails to load in the browser, the error message says:
java.lang.NoClassDefFoundError: ForCounter (wrong name: ch05/fig05_02/ForCounter)
// ForCounter is the name of my class
if I removed the package statement from the *.java file and recompile the same class the applet get loaded and run perfect
here is my html file:
<html>
<applet code="ForCounter.class" width=275 height=105>
</applet>
</html>
I have the same problem with my servlets only if they are in the default package they can be run if they are part of any package I get the error
please help

