About how to solve the problem that browsers cannot run small applications, browser applications
After learning Java, I found that java has a small application (applet) that can run on the webpage, I just wanted to use apache to get a local website to play the online game written in Java on it. So I was very happy to be ready, but later I discovered that, the applet I wrote cannot run on my browser. Later, I finally solved the problem through my own efforts. Now I will share this with you, I hope this will help you solve the problem that cannot be run.
1. For security reasons, the application must now meet some security settings. Java will prevent apple from running the program,
Or:
Appears
The following methods can be used to solve any java security issues:
First Open Control Panel-> select a program in category
Click java and select the Security tab in the java Control Panel.
After the selection, click Edit Site List and click Add
Later
Enter file :///
Click "OK". A security warning is displayed. Click "continue ".
This indicates that the application is successfully clicked and then click OK.
2. About the status of running the applet small application:
ClassNotFoundException occurs because the current class cannot be found. The solution is as follows:
(1) There are two scenarios for writing a small application in eclipse: first, the java class is in the determined package,
For example, if my package name is testapplet, I put the webpage code in the bin directory under the java directory in the same directory, and the package name is at the same level.
When writing html, you should write the package name/compiled class name *. class behind the cdoe. My name is testApplet. class.
After the preceding settings are complete, you can start to open the browser again. If the browser is not closed at the time, restart the browser. If you want to ask me why, you need
Click on the operating system of applet(here we will not introduce more, and then click 123.html, the browser appears
This indicates that you have succeeded. Click "run:
Hello wrrld!
(2) The following is required for Apple programs written using the default package:
Place 123.html and the compiled testApplet. class file in the bin directory under the same directory, and change the webpage code:
Then run 123.html to see the effect. We will not demonstrate it here.
2. To run the applet on the ghost website, add http: // 127.0.0.1 to the list of exceptional sites and put the applet working directory under the directory of the website, the following is the same as above.
I have not obtained any information about how to separate the webpage from the *. class file. If anyone knows how to release the file, see the following article.
To me!
Finally, I wish you success.