不能 运行 小程序

can't run applets

我只是在学习有关 运行ning Java Applets 的教程,根据此文档 https://www.java.com/en/download/help/java_blocked.xml,如果我的简单 Applet 不遵循这些方面,似乎吼叫,我不能 运行 Java JRE 上的小程序。

* Unsigned application

An application without a certificate (i.e. unsigned apps), or missing
application Name and Publisher information are blocked by default. 
Running this kind of application is potentially unsafe and present 
higher level of risk.

* Self-signed application (Certificate not from trusted authority)

An application with self-signed certificate is blocked by default. 
Applications of this type present the highest level of risk because 
publisher is not identified and the application may be granted access 
to personal data on your computer.

* Jar file missing Permission Attribute

Permissions Attribute verifies that the application requests the permission
level that developer specified. If this attribute is not present, it might be
possible for an attacker to exploit a user by re-deploying an application that is 
signed with original certificate and running the application at a different
privilege level. 



我的问题是:是否有任何解决方法可以用来简化 运行 一个 Java Applet?



这是我的代码:

HelloWorldApplet.java

import java.awt.Graphics;

class HelloWorldApplet {

    public void paint(Graphics g) {

        g.drawString("Hello World!", 5, 25);

    }

}

HelloWorldApplet.html

<html>
    <head>
        <title> Hello! </title>
    </head>
    <body>
        <P> My Java applet says:
        <APPLET CODE="HelloWorldApplet.class" WIDTH=150 HEIGHT=25> 
    </body>
</html>



Obs.: 我也尝试在 Ubuntu 上使用 'appletviewer' 二进制文件,但效果不佳..

提前致谢!

如果您想学习,请不要为 Applets 而烦恼。为什么要学习不赞成的东西?查看仍然受支持的 Java Web Start。或者,如果您真的只是想学习 Java 使用在命令行启动的常规主应用程序。