I understand that there are a million of these messages, but none of them helped me, and so: I am trying to deploy a very simple applet that will not load properly. My HTML:
<html>
<head>
<meta http-equiv="Content-Type" content"text/html; charset=utf-8">
</head>
<body>
<applet code = "SimpleApplet.class"
width = "320" height = "100"></applet>
</body>
</html>
My Java:
package test;
import javax.swing.*;
public class SimpleApplet extends JApplet{
public void init(){
try{
SwingUtilities.invokeAndWait(new Runnable(){
public void run(){
JLabel lbl = new JLabel("Hello World");
add(lbl);
}
});
}
catch(Exception e){
System.out.println(e);
}
}
}
Both files are in the same directory.
/home/me/workspace/myProject/bin/test
If I run the applet myself through Eclipse, it works fine. When I open the page, I get an error
java.lang.NoClassDefFoundError: SimpleApplet (wrong name: test/SimpleApplet)
The error suggests that I misplaced or named something. However, having tried
<applet code = "test/SimpleApplet.class"
width = "320" height = "100"></applet>
<applet code = "SimpleApplet.class"
codebase = "/test"
width = "320" height = "100"></applet>
, ", .java, , ClassNotFoundException. , classpath codebase ( ) . jar . - , ?