Java jnlp to run with 32 bit version

Our java client app needs 32 bit java because of the DLLs used. There is no option for 64 bit jvm. But our customers, over 300 users, need 64-bit jvm installed on their computers, because another application needs 64-bit jvm for their systems (windows). As a result, they have to install both 32 and 64 bits of jvm. When we click on our jnlp, it starts automatically with 64 bit jvm and our program crashes. Is there any option / syntax in the jnlp file to force the installation of a specific jvm? I do not mean libraries or nativelibs, I mean when our jnlp file is clicked, a 32 bit jvm should start.

It is not possible / possible to edit environment path variables for 300 clients, we need a global solution, just by editing our jnlp. Is it possible?

+3


source to share


1 answer


You can force javaws to use the 32 bit JRE by specifying an invalid j2se version for the 64 bit version (1.0.0 in the example below), note that for the j2se version it needs to be specified in the resources section for specific arch to work).

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:///c:/jnlp" href="demo.jnlp">
    <information>
        <title>Demo</title>  
    </information>
    <security>
        <all-permissions/>
    </security> 
    <resources>
        <jar href="demo.jar" />
    </resources>
    <resources os="Windows" arch="amd64">
        <j2se version="1.0.0"/>
    </resources>    
    <resources os="Windows" arch="x86">
        <j2se version="1.8+"/>
        <jar href="win32/swt.jar"/>
    </resources>
    <application-desc main-class="package.to.MainClass"/>
</jnlp>

      



Note that this is a bit of a dirty hack and may stop working with a future version.

+1


source







All Articles