如何使用 jnlp 为 32 位和 64 位正确部署桌面 JavaFx 2.0 应用程序? [英] How to deploy a desktop JavaFx 2.0 application correctly using jnlp for 32 and 64 bit?

查看:34
本文介绍了如何使用 jnlp 为 32 位和 64 位正确部署桌面 JavaFx 2.0 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 jnlp 文件用于部署我的 javafx 2.0 应用程序,但是,我如何确保用户拥有正确的 javafx 运行时(32 位或 64 位,取决于机器上存在的 jvm),如果没有,请下载它并运行应用程序.

I have a jnlp file for deploying my javafx 2.0 application, however, how do I make sure that the users have the correct javafx runtime (32 or 64 bit depending on the jvm present on the machine) and if not, download it and run the application.

假设用户当前没有安装 javafx 运行时,我在 64 位机器上面临的主要问题是 32 位、64 位或两者兼有 JRE:

Assuming that the user does not have a javafx runtime currently installed, the problems that I'm facing mostly with a 64 bit machine with either 32-bit, 64-bit or both JRE's are:

1) Javafx swing部署指南中提到使用<jfx:javafx-runtime version/>标签来下载合适的jfx运行时,但是1.7以下的JRE不理解这个标签/命名空间.

1) The Javafx swing deployment guide mentions to use the <jfx:javafx-runtime version /> tag to download the appropriate jfx runtime, but JRE below 1.7 doesn't understand this tag/namespace.

2) 如果 64 位机器上安装了 32 位 jre,那么我如何将我的应用程序安装到Program Files(x86)"文件夹,下载并使用 32 位 javafx 运行时.

2) If a 32-bit jre is installed on a 64-bit machine, then how do I install my application to the "Program Files(x86)" folder, download and use 32-bit javafx runtime.

3) 如果 64 位机器上安装了 64 位 jre,那么我如何将我的应用程序安装到Program Files"文件夹,下载并使用 64 位 javafx 运行时.

3) If a 64-bit jre is installed on a 64-bit machine, then how do I install my application to the "Program Files" folder, download and use 64-bit javafx runtime.

这是我的 jnlp 文件当前的样子:

Here is how my jnlp file looks currently:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:///C%3A/Program%20Files/HP/Pulse/PulseLite"href="iMonLauncher.jnlp">
    <information>      
        <title>iMonLauncher</title>  
        <vendor>Administrator</vendor>   
        <homepage href="file:///C%3A/Program%20Files/HP/Pulse/PulseLite"/>     
        <description>iMonLauncher</description>  
        <offline-allowed/>    
    </information>   
    <security>      
        <all-permissions/>  
    </security> 
    <resources> 
        <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="iMon.jar" size="428419"/>         
         <jar href="lib/ibase-core.jar" size="197029"/>
         <jar href="lib/ibase-fx.jar" size="210175"/>
         <jar href="lib/imonDB.jar" main="true" size="156616"/>
         <jar href="lib/imon-service.jar" main="true" size="73190"/>
         </resources>
     <application-desc name="iMon" main-class="imon.Main" >
     </application-desc>
     <update check="always"/>

代码库会自动更改,以根据架构指向正确的程序文件夹.

The codebase changes automatically, to point to the correct program files folder depending on the architecture.

提前致谢!

推荐答案

您错过了 jnlp 中的 xmlns:jfx 命名空间.它应该以

You miss xmlns:jfx namespace in your jnlp. It should starts with

<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="iMonLauncher.jnlp">

一旦用户安装了常规 java 并单击此类 jnlp 文件,他将看到 FX 的自动下载消息.它将找出使用的 java,下载并安装合适的 javafx 版本.

Once user has regular java installed and clicked on such jnlp file he would be presented with automatic download message for FX. It will find out which java is used, download and install approprivate javafx version.

这篇关于如何使用 jnlp 为 32 位和 64 位正确部署桌面 JavaFx 2.0 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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