简体   繁体   English

Java部署规则集无法与小程序一起正常使用

[英]Java Deployment Rule Set not working as expected with applets

I need to create a deployment rule set which decides whether an application (webstart or applet) will be executed using Java 1.6.0_31 or 1.8.0_45. 我需要创建一个部署规则集,该规则集决定将使用Java 1.6.0_31还是1.8.0_45执行应用程序(webstart或applet)。 Initially I want to use 1.6.0_31 for all internally developed applications and then gradually use 1.8.0_45 for specific applications that are proven compatible with Java 8. Since all those applications are signed using our own certificate, my idea was to use this certificate as a criterion in the rule set. 最初,我想对所有内部开发的应用程序使用1.6.0_31,然后逐渐对已证明与Java 8兼容的特定应用程序使用1.8.0_45。由于所有这些应用程序都使用我们自己的证书进行了签名,因此我的想法是将该证书用作规则集中的标准。 Here is my initial configuration: 这是我的初始配置:

<ruleset version="1.0+">
  <rule>
    <id title="--My Java 8 compatible application--">
        <certificate hash="--mycertificatehash--"/>
    </id>
    <action permission="run" version="1.8.0_45" force="true"/>
  </rule>
  <rule>
    <id>
        <certificate hash="--mycertificatehash--"/>
    </id>
    <action permission="run" version="1.6.0_31" force="true"/>
  </rule>
  <rule>
    <id />
    <action permission="default"/>
  </rule>
</ruleset>

For webstart applications this configuration works just as I would expect. 对于Webstart应用程序,此配置可以按我期望的那样工作。 Unfortunately I am experiencing problems when it comes to applets. 不幸的是,关于小程序,我遇到了问题。 When I launch an applet in the browser, an error message claims that the required Java version 1.6.0_31 is not installed. 在浏览器中启动小程序时,出现错误消息,提示未安装所需的Java版本1.6.0_31。 This behaviour can be reconstructed in Firefox as well as Internet Explorer. 可以在Firefox和Internet Explorer中重建此行为。 I tried my luck with "1.6", "6", "1.6*" and many more as value for the version attribute in the rule set but nothing worked. 我尝试使用“ 1.6”,“ 6”,“ 1.6 *”以及更多作为规则集中version属性值的运气,但没有任何效果。 The last thing I tried was adding this rule to the top of my ruleset: 我尝试的最后一件事是将此规则添加到规则集的顶部:

<rule>
  <id location="--myserver--"/>
  <action permission="run" version="1.6.0_31" force="true"/>
</rule>

And suddenly my applet launched and it used Java 6. 突然我的小程序启动并使用Java 6。

Does anybody have an idea why my initial configuration did not work for the applet? 有人知道为什么我的初始配置不能用于applet吗? I am really trying to understand how the deployment rule set mechanisms work and what my mistake was in the initial configuration. 我实际上是在尝试了解部署规则集机制的工作方式以及初始配置中的错误。

Two possible issues. 两个可能的问题。

I noticed some irregularity with the DRS if an XML header is missing. 如果缺少XML标头,我会注意到DRS有一些不规范之处。 Placing a header in the file worked for similar issues I was having. 将标题放在文件中可解决我遇到的类似问题。

The other thing that might cause issues is that Java documentation states the "Force" option is for versions 1.1 and greater. 可能引起问题的另一件事是Java文档指出“ Force”选项适用于1.1版或更高版本。

" Example 28-6 Force the Use of a Specific JRE" http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/deployment_rules.html 示例28-6强制使用特定的JRE” http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/deployment_rules.html

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

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