I am new to Java. I wrote a very simple applet. It works fine with the Eclipse browser. When I tried to load it on to web browser, classDefNotFound exception arises.
Here is my code for the applet:
Here is my html file:
My Project hierarchy is like this.
My class file goes into: FirstApplet/bin/com/example/applet/MyApplet.class
DrawOval.html is also in the same directory after I build my project.
I tried using relative path in the CODEBASE to the applet class. It didnt work either. Please help me find the reason.
The code attribute of an applet element requires the fully qualified class name of the class. That would be com.example.applet.MyApplet Furthermore, whether it is stored in a Jar or as a loose class on the server, it needs to be in a directory structure that reflects that package structure. As a loose class, with no codebase specified, the class would need to be located at com/example/applet/MyApplet.class, where the com directory is in the same directory as the HTML.