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

查看:49
本文介绍了如何在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 Runtime Environment(JRE)版本以及标准 Java虚拟机的参数.如果有几个JRE 指定,这表示受支持的JRE的优先列表, 首先是最喜欢的版本.

The j2se element specifies what Java 2 SE Runtime Environment (JRE) versions an application is supported on, as well as standard parameters to the Java Virtual Machine. If several JREs are specified, this indicates a prioritized list of the supported JREs, with the most preferred version first.

我还研究了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天全站免登陆