How to deploy a desktop JavaFx 2.0 application correctly using jnlp for 32 and 64 bit?

点点圈 提交于 2019-12-21 05:07:19

问题


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.

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) 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) 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) 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.

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.

Thanks in advance !


回答1:


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

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

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.



来源:https://stackoverflow.com/questions/8176237/how-to-deploy-a-desktop-javafx-2-0-application-correctly-using-jnlp-for-32-and-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!