Click here to Skip to main content
15,512,456 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I write a java applet program in netbeans IDE. But when I test it in applet viewer it does not appear and give me this error:
java.lang.NoClassDefFoundError: OtheApplet (wrong name: OthelloGame/OtheApplet)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NoClassDefFoundError: OtheApplet (wrong name: OthelloGame/OtheApplet)


My html file contains:
 <html>
  <head>
    <title>Othello Evaluation Environment</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
      <applet code="OtheApplet.class" width="600" height="500">

      </applet>

  </body>

</html>


What is the problem?
please can anyone help me :(
Thank you....
Posted
Updated 9-Apr-11 7:50am
v5

Hey just try
<html>  <head>    <title>Othello Evaluation Environment</title> 
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
</head>  <body>      <applet code="OtheApplet" width="600" height="500">      </applet>  </body></html>


And yes your class name must match with applet code name in even capital and small case
 
Share this answer
 
Comments
caabool_oo 9-Apr-11 2:55am    
Thank you but not working..:(

any other ideas..
caabool_oo 9-Apr-11 2:59am    
in netbeans the java files and classes saved in different location..
is this a problem ??
Thank you very much...

I found the solution..

the .html file must be located out side the pakage..

thank you..:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900