简体   繁体   English

Applet被Java 7中的Java安全设置阻止

[英]Applet blocked by java security settings in java 7

I am trying to deploy a test demo applet. 我正在尝试部署测试演示小程序。 The code of applet is presented in following 小程序的代码如下所示


import java.applet.Applet;
import java.awt.Graphics;

public class TestApplet extends Applet{

    public void paint(Graphics gh){
        gh.drawString("hello world", 300, 200);
    }
}

I have also used a manifest file which is included in jar containing the following lines 我还使用了清单文件,该清单文件包含在jar中,包含以下几行

Permissions: sandbox 权限:沙箱

Application-Name: Applet Demo 应用名称:Applet演示

Then I have signed the jar using jarsigner with a keystore containing trusted certificate from thawte . 然后,我使用jarsigner和包含来自thawte的可信证书的密钥库对jar进行了签名。 Jarsigner can also verify the signed jar with appropriate certificate chain. Jarsigner还可以使用适当的证书链来验证已签名的jar。 I have also installed that .p12(keystore) file in the system 我还已经在系统中安装了.p12(keystore)文件

After that I tried to load the applet from local server through Chrome browser. 之后,我尝试通过Chrome浏览器从本地服务器加载applet。 Following is my html code 以下是我的html代码

<html>
<Title>Applet Testing</Title>
<hr>
<applet code="TestApplet.class"
    archive="SignedTestApplet.jar"
    width="480" height="320">
<param name="Permissions" value="sandbox"/>
<param name="Application-Name" value="Applet Demo"/>
</applet>
<hr>
<html>

After following all the procedures described above, I get the following pop-up response 完成上述所有步骤后,我将收到以下弹出响应


Your security settings have blocked an application from running with an out-of-date or expired version of java 您的安全设置已阻止应用程序使用Java的过期或过期版本


I am using java 7 update 60 and it works if I set the security level as medium from Java Control Panel, but I have to keep the level as high. 我正在使用Java 7 Update 60,并且如果我从Java控制面板中将安全级别设置为中级,则可以使用,但是我必须保持该级别为高。

Is there any flaw in my procedures or what should be done?? 我的程序中是否有任何缺陷或应该怎么做?

Please suggest me. 请给我建议。

You are trying to load the java applet by an old method which has been changed. 您正在尝试通过已更改的旧方法加载Java applet。 A new method has been introduced which uses JNLP (Java Network Launch Protocol). 引入了一种使用JNLP(Java网络启动协议)的新方法。 Please try to deploy your applet following the instructions described in this LINK 请按照此LINK中所述的说明尝试部署您的applet

You have a few options: 您有几种选择:

  1. Install a newer version of Java (Java 8 is now available). 安装Java较新版本 (现已提供Java 8)。 If you go to about:plugins in Chrome, you can find Java here and which version your browser is using (there is an 'Always Allowed' checkbox here too, but it seemingly has no effect for me). 如果您转到Chrome中的about:plugins ,则可以在此处找到Java以及您的浏览器正在使用的版本(此处也有“始终允许”复选框,但这似乎对我没有影响)。
  2. Start Chrome with the flag --allow-outdated-plugins - See the related Chrome help page for info on this. 使用--allow-outdated-plugins标志启动Chrome-有关此信息,请参阅相关的Chrome帮助页面
  3. Set security level as medium from Java Control Panel (as you describe in your question). 在Java控制面板中将安全级别设置为中(如您在问题中所述)。

From Java 7 Update 10 on all Java releases have an expiration date . 从Java 7 Update 10开始,所有Java发行版都有有效期 Whenever a critical patch update ( CPU ) is released, the older versions expire. 每当发布关键补丁更新( CPU )时,旧版本就会过期。

There were 3 CPUs released for Java 7 since 7u60. 自7u60以来,已经为Java 7发布了3个CPU You should update to 7u75 or 7u76. 您应该更新为7u75或7u76。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM