I have an issue with a Java applet in Chrome. An error message: java(TM) platform SE8 U40 HAS crashed
appears.
After searching the internet, I enabled Java in the browser. I also changed the Java security settings, but it still does not work.
Testing my applet using Applet Viewer command in a terminal produces an error message too:
java.lang.NoClassDefFoundError : firstapplet
In my folder i have class (FirstApplet.class
) and the html page(page.html
) and FirstApplet.java
page.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="#0000FF">
<applet code="FirstApplet" width="500" height="500"></applet>
</body>
</html>
FirstApplet.java
import java.applet.Applet;
import java.awt.Button;
import java.awt.Label;
import java.awt.TextField;
public class FirstApplet extends Applet{
public void init(){
add(new Label("Nom:"));
add(new TextField(12));
add(new Button("ok"));
}
}
please help me to solve this problem thanks you