64-bit Java application on a 32-bit Java process

Comments

2 comments

  • Avatar
    juanjo

    The installer is probably using a 32 bit java binary to create the launcher. You could either customize the <preferredJavaBinary> or make it use the autodetected 64bit java binary:

       <createJavaLaunchers>
            <destination>${installdir}</destination>
            <javaLauncherList>
                 <javaLauncher>
                     ...
                    <validVersionList>
                       <validVersion>
                           <bitness>64</bitness>
                        </validVersion>
                     </validVersionList>
                     ...
                </javaLauncher>
            </javaLauncherList>
            <ruleList>
               <platformTest type="windows-x64"/>
            </ruleList>
        </createJavaLaunchers>
    
  • Avatar
    wojciechka

    I have just doublechecked and on 64bit Windows 8 the following worked properly:

    <createJavaLaunchers> <destination>${installdir}</destination> <javaLauncherList> <javaLauncher> <allowCommandLineArguments>1</allowCommandLineArguments> <arguments></arguments> <binaryName>testApp</binaryName> <classpath></classpath> <jarFile>test.jar</jarFile> <mainClass></mainClass> <preferredJavaBinary></preferredJavaBinary> <requestedExecutionLevel>highestAvailable</requestedExecutionLevel> <runInConsole>0</runInConsole> <vmParameters> -Xms1024m -Xmx1024m -XX:MaxNewSize=512m -XX:NewSize=512m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:TargetSurvivorRatio=90 -verbose:gc -Xincgc </vmParameters> <windowsResourceComments> java launcher</windowsResourceComments> <windowsResourceCompanyName>Test</windowsResourceCompanyName> <windowsResourceFileVersion>1.0.0.0</windowsResourceFileVersion> <windowsResourceProductName>TestApp</windowsResourceProductName> <windowsResourceProductVersion>1.0</windowsResourceProductVersion> <workingDirectory>${installdir}</workingDirectory> <validVersionList> <validVersion> <bitness>64</bitness> <maxVersion></maxVersion> <minVersion></minVersion> <requireJDK>0</requireJDK> <vendor></vendor> </validVersion> </validVersionList> </javaLauncher> </javaLauncherList> </createJavaLaunchers>

    That is - it did find 64-bit Java on the system and ran the application as 64-bit process.

    Can you doublecheck that you have 64-bit Java installed? Also, can you doublecheck if it is also causing problems using latest version of InstallBuilder?

    A lot of users may not have 64-bit Java, so you can also either bundle your own Java binaries or detect if 64-bit Java is present and then enforce the launcher to use - for example:

    <setInstallerVariable> <name>preferred_bitness</name> <value>64</value> </setInstallerVariable> <autodetectJava> <abortOnError>0</abortOnError> <promptUser>0</promptUser> <showMessageOnError>0</showMessageOnError> <onErrorActionList> <setInstallerVariable> <name>preferred_bitness</name> <value></value> </setInstallerVariable> </onErrorActionList> <validVersionList> <validVersion> <bitness>64</bitness> <maxVersion></maxVersion> <minVersion></minVersion> <requireJDK>0</requireJDK> <vendor></vendor> </validVersion> </validVersionList> </autodetectJava>

    And then specify ${preferred_bitness} for <bitness> in the <javaLauncher>'s valid version list.

    This will set preferred_bitness to 64 if 64-bit Java is available or set it to any bitness (empty string) if it is not found.

    Information on bundling Java runtime in InstallBuilder binaries can be found in Bundling a JRE section of InstallBuilder User Guide.

Please sign in to leave a comment.