如何在 jnlp 文件中指定 JRE 范围? [英] How to specify a JRE range in jnlp file?

查看:45
本文介绍了如何在 jnlp 文件中指定 JRE 范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用 Java Web Start 的 Java 应用程序.jnlp 文件配置为 [j2se version="1.5+"].因此,如果安装了 JRE 1.5 和 1.6,则应用会在 1.6 上运行.

We have a java app which uses Java Web Start. The jnlp file is configured with [j2se version="1.5+"]. So if JRE 1.5 and 1.6 are installed, the app is run on 1.6.

现在,我们要求限制应用程序只能在以下范围内运行 - JRE 1.5.0_07 到 JRE 1.5.0_17

Now, we have requirement where the app should be restricted to run only within the range - JRE 1.5.0_07 through JRE 1.5.0_17

[j2se version="1.5*"] 将不起作用 - 它将始终使用 1.5 系列的最新 jre 启动应用程序.

[j2se version="1.5*"] will not work - it will always launch the app with the latest jre from 1.5 family.

我可以通过包含 href 属性来请求准确的产品版本.[j2se version="1.5.0_14" href="http://java.sun.com/products/autodl/j2se"/]

I can request an exact product version by including the href attribute. [j2se version="1.5.0_14" href="http://java.sun.com/products/autodl/j2se"/]

但是如何在 jnlp 文件中指定特定范围的 JRE,以便 JWS 仅从该范围中选取 JRE?因此,如果安装了 1.5.0_07、1.5.0_17 和 JRE 6,它应该在 1.5.0_17 上运行应用程序.

But how do I specify a specific range of JREs in the jnlp file so that JWS picks up a JRE from that range only? So if 1.5.0_07, 1.5.0_17 and JRE 6 are installed, it should run the app on 1.5.0_17.

有什么好的方法可以做到这一点吗?

Is there a good way to accomplish this?

推荐答案

我想你想要的是:

<j2se version="1.5.0_17" />
<j2se version="1.5.0_16" />
<j2se version="1.5.0_15" />
<j2se version="1.5.0_14" />
<j2se version="1.5.0_13" />
<j2se version="1.5.0_12" />
<j2se version="1.5.0_11" />
<j2se version="1.5.0_10" />
<j2se version="1.5.0_09" />
<j2se version="1.5.0_08" />
<j2se version="1.5.0_07" />

参见:http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html#resources

j2se 元素指定应用程序支持的 Java 2 SE 运行时环境 (JRE) 版本以及标准Java 虚拟机的参数.如果多个 JRE 是指定,这表示支持的 JRE 的优先列表,优先选择最喜欢的版本.

我还研究了 Java 6/Java 7,它看起来也可以在那里工作.

I've also looked at the Java 6 / Java 7 at it looks like it will work there as well.

http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html#resources

http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html#resources

这篇关于如何在 jnlp 文件中指定 JRE 范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆