简体   繁体   English

自定义Java Web Start

[英]Customize Java Web Start

I have an issue concerning JNLP / Java Web Start. 我有一个关于JNLP / Java Web Start的问题。 I have absolutely no knowledge of JNLP. 我完全不了解JNLP。

A (Swing) application is compiled with JDK 1.7 (source and target) and launched by client via Web Start. 使用JDK 1.7(源和目标)编译(Swing)应用程序,并由客户端通过Web Start启动。

This is the JNLP file, unimportant info omitted: 这是JNLP文件,省略了不重要的信息:

<jnlp spec="1.0+" codebase="http://someurl" href="http://someurl/launcher.jnlp">
<information>
    <title>...</title>
    <vendor>...</vendor>
    <homepage href="www.mycom.com" />
    <description>...</description>
</information>

<security>
    <all-permissions />
</security>

<update check="always" policy="always"/>

<resources>
    <java version="1.5+" initial-heap-size="128M" max-heap-size="256M"/>
    <jar href="lib/main.jar" main="true"/>              
    <jar href="lib/other.jar"/>
</resources>

<application-desc main-class="com.pkg.Launcher"/>
</jnlp>

Problem one: 问题一:

Whenever a client has a JRE 1.6 installed (or a least JAVA_HOME or PATH is set to it), Web Start doesn't start at all. 每当客户端安装了JRE 1.6(或者至少设置了JAVA_HOME或PATH)时,Web Start根本不启动。

Desired behavior 期望的行为

Download Java 7 JRE 下载Java 7 JRE

Problem two: 问题二:

If V 7 is installed on the client machine, the launcher prompts to download an up-to-date version, with an option to update now / postpone for later. 如果客户端计算机上安装了V 7,则启动程序会提示下载最新版本,并提供立即更新/推迟以供日后使用的选项。

Desired behavior 期望的行为

Do the update in background / somehow ignore it as long as this message will not appear. 只要不显示此消息,在后台进行更新/以某种方式忽略它。

Regarding your first problem, if you want Java 1.7+, then just say so in your resources. 关于你的第一个问题,如果你想要Java 1.7+,那么就在资源中说出来。 Replace: 更换:

<java version="1.5+" initial-heap-size="128M" max-heap-size="256M"/>

with: 有:

<java version="1.7+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="128M" max-heap-size="256M"/>

The href part will ask the client to download Java 7 if it is still on Java 6 (or less). 如果Java 7仍在Java 6(或更低版本)上,则href部分将要求客户端下载Java 7。

I don't know how to solve your second problem. 我不知道如何解决你的第二个问题。

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

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